Why 10^4 is not = 0.0001

Why ?
0.00009999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 is not = to 0.0001 ... (just kidding)

Thank's !


What is the problem ? A bug, java ?

If google says it, it's true ! :wink:

Maybe it is floating-point precision error or Snap! just forgot to round it off.

Here's my guess: 10^ with a positive integer exponent is computed by repeated multiplication, so it gets an exact answer. Or maybe that's true only for small positive integer exponents. For any other kind of exponent, it uses an approximation to an infinite series, so the steps of the computation are different.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.