爲什麼會發生這種情況,我該如何避免這個問題?Python中的浮點數減法運算
Python 2.7.5 (default, Jun 27 2013, 09:29:43)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.3 - 0.1 - 0.1 - 0.1
2.7755575615628914e-17
>>> 0.3 - 0.3
0.0
>>> 0.3 - 0.2
0.09999999999999998
[浮點限制](http://stackoverflow.com/questions/406361/floating-point-limitations)和http://stackoverflow.com/questions/588004/is-javascripts-floatingpoint -math-broken –