小数取模运算

606/0.6 = 1010.0

606%0.6 = 2.2426505097428162e-14

math.fmod(606,0.6) = 2.2426505097428162e-14

60.6/6 = 10.1

60.6%6 = 0.6000000000000014

math.fmod(60.6,6) = 0.6000000000000014

60.6/0.6 = 101.0

60.6%0.6 = 3.6637359812630166e-15

math.fmod(60.6,0.6) = 3.6637359812630166e-15

避免小数取模。

猜你喜欢

转载自blog.csdn.net/lcczzu/article/details/88389243