浮点数取余方法:x-(math.floor(x/y)*y)
>>> import math>>> x=9.7;y=3.1>>> x-(math.floor (x/y)*y)0.3999999999999986