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

search for in the

gmp_prob_prime> <gmp_pow
[edit] Last updated: Fri, 17 May 2013

view this page in

gmp_powm

(PHP 4 >= 4.0.4, PHP 5)

gmp_powmべき乗とモジュロを計算する

説明

resource gmp_powm ( resource $base , resource $exp , resource $mod )

mod を法として (baseexp 乗) を計算します。 exp が負の場合、結果は未定義(undefined) となります。

パラメータ

base

もととなる数。

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

exp

正の数で、base を何乗するかを指定します。

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

mod

モジュロ。

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

返り値

結果を GMP 数で返します。

例1 gmp_powm() の例

<?php
$pow1 
gmp_powm("2""31""2147483649");
echo 
gmp_strval($pow1) . "\n";
?>

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

2147483648



add a note add a note User Contributed Notes gmp_powm - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites