왜 이런 일이 발생하며이 문제를 방지하려면 어떻게해야합니까?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-floating-point 가능한 복제본 -math-broken –