跟老齐学Python之啰嗦的除法

2019-10-05 20:04:40于海丽

Note:
The behavior of round() for floats can be surprising: for example, round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: it's a result of the fact that most decimal fractions can't be represented exactly as a float. See Floating Point Arithmetic: Issues and Limitations for more information.

原来真的轮不到我。(垂头丧气状。)

似乎除法的问题到此要结束了,其实远远没有,不过,做为初学者,至此即可。还留下了很多话题,比如如何处理循环小数问题,我肯定不会让有探索精神的朋友失望的,在我的github中有这样一个轮子,如果要深入研究,可以来这里尝试。