Home > PHP > Function > GMP > gmp_powm()

gmp_powm()

gmp_powm - Raise number into power with modulo

Syntax

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

Arguments

  • base - The base number. It can be either a GMP number resource, or a numeric string given that it is possible to convert the latter to a number.
  • exp - The positive power to raise the base. It can be either a GMP number resource, or a numeric string given that it is possible to convert the latter to a number.
  • mod - The modulo. It can be either a GMP number resource, or a numeric string given that it is possible to convert the latter to a number.

Description

Calculate ( base raised into power exp) modulo mod. If exp is negative, result is undefined.

Version

PHP 4.0.4, 5

Return value

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