Except that with xpheas method, you lose all the benefits of arbitrary precision as the * operator only works on int and float and those are restricted in length (See int ant float types for more information).
bcmul
(PHP 4, PHP 5)
bcmul — Moltiplica due numeri a precisione arbitraria
Descrizione
string bcmul
( string $primo operando
, string $secondo operando
[, int $precisione
] )
Moltiplica il primo operando per il secondo operando e restituisce il risultato. Il parametro opzionale precisione imposta il numero di cifre dopo il punto decimale nel risultato.
Esempi
Example #1 esempio di bcmul()
<?php
echo bcmul(1.34747474747, 35, 3); // 47.162
echo bcmul(2, 4); // 8
?>
Vedere anche:
bcmul
ju(...)
02-Apr-2008 10:00
02-Apr-2008 10:00
xpheas (at) gmail . com
14-Jun-2007 05:13
14-Jun-2007 05:13
if you have compiled php width "--disable-bcmath", you can use this:
<?php
function bcmul($_ro, $_lo, $_scale=0)
{
return round($_ro*$_lo, $_scale);
}
?>
