0

I just moved from Python 2.7 to 3 and I have the following strange issue.

Expected behavior:

a = 0.07
b = 0.08
a+b
>> 0.15

What I get instead:

a = 0.07
b = 0.08
a+b
>> 0.15000000000000002

My Environment:

import sys
print(sys.version)
>> 3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
Tasos
  • 7,325
  • 18
  • 83
  • 176

0 Answers0