gmp_powm

PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8
gmp_powm - Raise number into power with modulo
Manual
Code Examples

gmp_powm( GMP|int|string$num, GMP|int|string$exponent, GMP|int|string$modulus ): GMP

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

Parameters

num

The base number.

A GMP object, an int or a numeric string.

exponent

The positive power to raise the num.

A GMP object, an int or a numeric string.

modulus

The modulo.

A GMP object, an int or a numeric string.

Return Values

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

Example of gmp_powm

Show all examples for gmp_powm

PHP Version: