PHP.nl

gmp_powm

gmp_powm

Raise number into power with modulo

GMP **gmp_powm**  $num  $exponent  $modulus

Calculate ( raised into power ) modulo . If is negative, result is undefined. num``exponent``modulus``exponent

numThe base number.

exponent The positive power to raise the . num

modulusThe modulo.

The new (raised) number, as a GMP number.

Voorbeeld: example

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