float(3.90-3)没有给出3的答案

时间:2019-05-27 10:24:58

标签: python math int rounding

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> float(3.90-3)
0.8999999999999999
>>> 

预期答案为3。为什么python回答0.8999999999?

0 个答案:

没有答案