Possible Duplicate:
How is floating point stored? When does it matter?
Using the built-in calculator on my Win7 x64 I get the number -8.1648465955514287168521180122928e-39
when calculation sqrt(4)-2
.
I would expect the result to be 0.
Possible Duplicate:
How is floating point stored? When does it matter?
Using the built-in calculator on my Win7 x64 I get the number -8.1648465955514287168521180122928e-39
when calculation sqrt(4)-2
.
I would expect the result to be 0.
There's some error with floating-point values, when you go to subtract them on occasion. You may get a representation that's 0 or really close to 0 (10^-39's pretty close).
For more information, check out Fractions in Binary on Wikipedia.