Re:1.15 * 100 = 149.99999999999999 except in Ruby
by gus_massa on Friday December 16, 2011 @12:34PM
(#3361351)
The problem is that the decimal numbers in IEEE-754 are approximated by fractions where the denominator is a power of 2.
So
And then
You can read a more detailed analysis of how .1 is represented in Python in: http://docs.python.org/tutorial/floatingpoint.html
[ Parent
| on HN ]
There are no comments on this comment yet.