0

I am just starting with python and was running through a tutorial here

Running the exmamples, I was surprised to find print("123.56 - 62.12 =", 123.56 - 62.12)

To come out as 123.56 - 62.12 = 61.440000000000005

I am running python v3.3.0 Ran it in an online interpreter here and got the same

demiurg
  • 108
  • 10
  • 4
    See [What Every Computer Scientist Should Know About Floating-Point Arithmetic](http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html). It should be required reading for everyone on this site. – jwodder Apr 06 '13 at 20:33
  • jwodder, I've seen that article, but I think it's a little hard to read and I don't see anything about a simple subtraction in that article, mostly division rounding things – demiurg Apr 06 '13 at 20:40

0 Answers0