有没有像“bcadd”这样的函数,除了它执行乘法?

时间:2012-03-16 02:41:17

标签: php

我希望对表示为字符串的数字进行一些数学运算。到目前为止,我还没有找到任何可以进行乘法的东西。

谢谢!

3 个答案:

答案 0 :(得分:3)

您需要bcmul()方法。您也可以查看BC Math函数。

示例

echo bcmul('2.123456', '4.7891011', 6); // 6 is the precision

答案 1 :(得分:0)

你的意思是bcmul

答案 2 :(得分:0)

http://www.php.net/manual/en/function.bcmul.php

  

bcmul - 将两个任意精度数乘以

     

string bcmul(string $ left_operand,string $ right_operand [,int $ scale])

     

将left_operand乘以right_operand。