The calculation
256*timer0counter+TCNT0
saves temporary value in 'default' size int, which on AVR is 16b. so, every time timer0counter is higher than 256 it will overflow regardless of the final type of the variable.
instead of doing
range=(256*timer0counter+TCNT0)*32*0.017;
try going with:
double range_real = 256.0 * (double)timer0counter + (double)TCNT0 * 32.0 * 0.017;
range = (int) range_real;
Being explicit about types can really save your skin.