PHP gmp_mul() Error: Unable to convert variable to GMP - wrong type
PHP gmp_mul() Error: Unable to convert variable to GMP - wrong type
我正在使用 PHP gmp 函数。
我想做以下数学陈述:
$profit_percent = 2405.665;
$bill_line['purchase_average_value'] = 36000000000;
$r = (1 + ($profit_percent / 100));
$r2 = $bill_line['purchase_average_value'];
$unit_price_with_profit = gmp_mul($r, $r2);
但是出现如下错误:
gmp_mul(): Unable to convert variable to GMP - wrong type
如果您看到 GMP library 的说明:
These functions allow for arbitrary-length integers to be worked with using the GNU MP library.
您正试图将一个浮点数传递给 gmp_mul()
。那总是会失败。
我正在使用 PHP gmp 函数。
我想做以下数学陈述:
$profit_percent = 2405.665;
$bill_line['purchase_average_value'] = 36000000000;
$r = (1 + ($profit_percent / 100));
$r2 = $bill_line['purchase_average_value'];
$unit_price_with_profit = gmp_mul($r, $r2);
但是出现如下错误:
gmp_mul(): Unable to convert variable to GMP - wrong type
如果您看到 GMP library 的说明:
These functions allow for arbitrary-length integers to be worked with using the GNU MP library.
您正试图将一个浮点数传递给 gmp_mul()
。那总是会失败。