Python math is off by .000000000000045

Ethan Furman ethan at stoneleaf.us
Tue Feb 28 12:56:34 EST 2012


Michael Torrie wrote:
> He's simply showing you the hex (binary) representation of the
> floating-point number's binary representation.  As you can clearly see
> in the case of 1.1, there is no finite sequence that can store that.
> You end up with repeating numbers.  

Thanks for the explanation.

> This should help you understand why you get errors
> doing simple things like x/y*y doesn't quite get you back to x.

I already understood that.  I just didn't understand what point he was 
trying to make since he gave no explanation.

~Ethan~



More information about the Python-list mailing list