1

I have tried to look it up but I can't seem to phrase it right.

why does 5.6 - 2.2 = 3.3999999999999995 in Python 3?

Sure I can get around this problem with the round() built in function, but I was struck to see this behaviour

5.6 - 2.2

I am using Python version 3.7.3

veziop
  • 65
  • 8
  • 1
    Not just in Python 3: in virtually _all_ languages, unless care is taken to use arbitrary precision math. That's how the floating point standard works. Please remember to search for existing documentation and questions before asking a new one as described in [ask]. – ChrisGPT was on strike Dec 26 '20 at 19:07

0 Answers0