©
This document uses PHP Chinese website manual Release
(PHP 4 >= 4.0.4, PHP 5, PHP 7)
gmp_powm — Raise number into power with modulo
$base
, GMP $exp
, GMP $mod
)
Calculate (base
raised into power
exp
) modulo mod
. If
exp
is negative, result is undefined.
base
The base number.
可以是一个 GMP 数据 resouce ,或一个可以转换为数值的字符串。
exp
The positive power to raise the base
.
可以是一个 GMP 数据 resouce ,或一个可以转换为数值的字符串。
mod
The modulo.
可以是一个 GMP 数据 resouce ,或一个可以转换为数值的字符串。
The new (raised) number, as a GMP number.
Example #1 gmp_powm() example
<?php
$pow1 = gmp_powm ( "2" , "31" , "2147483649" );
echo gmp_strval ( $pow1 ) . "\n" ;
?>
以上例程会输出:
2147483648