I encountered a strange float number problem of python(2.7.3).
In [4]: 17 * 0.1
Out[4]: 1.7000000000000002
but
In [5]: print(17*0.1)
1.7
Two questions:
- why
17*0.1is1.7000000000000002? - why
printis fine?
I encountered a strange float number problem of python(2.7.3).
In [4]: 17 * 0.1
Out[4]: 1.7000000000000002
but
In [5]: print(17*0.1)
1.7
Two questions:
17*0.1 is 1.7000000000000002 ?print is fine?