Given any positive range, count the values that are complete squares
Your algorithm is inefficient:


Floating-point arithmetic is slower than integer arithmetic.
To find all the perfect squares in a range, you need only find the square root of the minimum (and round up) and the square root of the maximum (and round down).


You should be able to find the answer in constant time, with no looping.