Gus*_*ooL 10 php decimal modulo
我怎么能用十进制值进行模运算,因为PHP只能用整数模数?
示例案例:
echo 1.92 % 1000; // (int) 1, expected result should be 1.92
有没有正确的库?
有关此模数算术问题的更多信息:https://bugs.php.net/bug.php?id = 34399
Mar*_*ker 29
还有一个浮点fmod()函数
echo fmod(1.92, 1000)
Alv*_*ome 5
http://php.net/manual/en/function.fmod.php
我想你想要这个,这会返回浮点结果?
归档时间:
13 年,3 月 前
查看次数:
4355 次
最近记录: