[Python]round四舍五入精度缺失的解决
2013-11-18
阅读 2 分钟
15.6kThe documentation for the built-in round() function says that it rounds to the nearest value, rounding ties away from zero. Since the decimal fraction 2.675 is exactly halfway between 2.67 and 2.68, you might expect the result here to be (a binary approximation to) 2.68. It’s not, because when th...