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

search for in the

gmp_neg> <gmp_mod
Last updated: Fri, 06 Nov 2009

view this page in

gmp_mul

(PHP 4 >= 4.0.4, PHP 5)

gmp_mul数値を乗算する

説明

resource gmp_mul ( resource $a , resource $b )

ab をかけ、 結果を返します。

パラメータ

a

b を掛けられる数。

GMP 数リソース、 あるいは数値に変換可能な数値形式の文字列。

b

a に掛ける数。

GMP 数リソース、 あるいは数値に変換可能な数値形式の文字列。

返り値

GMP 数リソースを返します。

例1 gmp_mul() の例

<?php
$mul 
gmp_mul("12345678""2000");
echo 
gmp_strval($mul) . "\n";
?>

上の例の出力は以下となります。

24691356000



add a note add a note User Contributed Notes
gmp_mul
06-Dec-2006 09:11
<?php
function fact($x)
{
  
$factorial = 1;
   for (
$i=2; $i < $x; $i++) {
      
$factorial = gmp_mul($factorial, $i);
   }
   return
$factorial;
}

echo
gmp_strval(fact(1000)) . "\n";
?>

gmp_neg> <gmp_mod
Last updated: Fri, 06 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites