sqrt confusion

I am completely new to C++ but have a need to tweak some existing code. My problem is sqrt, which always returns zero.

this is my added code

 
   const double        coc2 = sqrt(coc*coc - ((4.0*info->aperture*info->aperture)/225.0));


coc and info->aperature are defined as const uint64_t

coc2 always returns zero.

I'm baffled and likely thick! I hope some kind sole can put me out of my misery?
Heya, sqrt most certainly does return non-zero values- which you can see by the output from a cout << sqrt(12);

If you're getting bad values, you may want to verify the other values you're passing in are correct. The only way to get a 0 from a sqrt is to pass in a zero as far as I know:

http://www.wolframalpha.com/input/?i=sqrt%28x%29%3D0
Topic archived. No new replies allowed.