浮点型取余

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

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

posted on 2014-09-17 21:29  Mr.风的影子  阅读(450)  评论(0编辑  收藏  举报

导航