小数取模运算

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/lcczzu/article/details/88389243

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

 

 

避免小数取模。

展开阅读全文

没有更多推荐了,返回首页