PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

bcpow> <bcmod
Last updated: Fri, 18 Jul 2008

view this page in

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.34747474747353); // 47.162
echo bcmul(24); // 8
?>

Vedere anche:

bcdiv().



add a note add a note User Contributed Notes
bcmul
ju(...)
02-Apr-2008 01:00
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).
xpheas (at) gmail . com
14-Jun-2007 08: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);
  }
?>

bcpow> <bcmod
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites