PHP.nl

bcpowmod

bcpowmod

Raise an arbitrary precision number to another, reduced by a specified modulus

string **bcpowmod** string $num string $exponent string $modulus  $scale

Use the fast-exponentiation method to raise to the power with respect to the modulus . num``exponent``modulus

numThe base, as an integral string (i.e. the scale has to be zero).

exponentThe exponent, as an non-negative, integral string (i.e. the scale has to be zero).

modulusThe modulus, as an integral string (i.e. the scale has to be zero).

Returns the result as a string.

This function throws a in the following cases:

num``exponent``modulus``num``exponent``modulus``exponent``scale

This function throws a exception if is . modulus``0

The following two statements are functionally identical. The version however, executes in less time and can accept larger parameters.

`bcpowmod````php




> **Opmerking:** > Because this method uses the modulus operation, numbers which are not
>     positive integers may give unexpected results.


   
  `bcpow``bcmod``BcMath\Number::powmod`