浮点型取余

浮点数取余方法:x-(math.floor(x/y)*y)

>>> import math
>>> x=9.7;y=3.1
>>> x-(math.floor (x/y)*y)
0.3999999999999986

原文地址:https://www.cnblogs.com/sweet521/p/3978095.html