Python浮点数误差与解决方法
1.例子先放上几个程序的例子# 浮点数print("0.1 + 0.1 = ", 0.1 + 0.1)print("0.1 - 0.1 = ", 0.1 - 0.1)print("0.1 * 0.1 = ", 0.1 * 0.1) #计算机无法精确存储0.01,存储了它的近似值。print("0.1 / 0.1 = ", 0.1 / 0.1)print("0.3 == 3 * 0....
原创
2019-07-07 16:11:19 ·
14795 阅读 ·
3 评论