gmp_random_bits

(PHP 5, PHP 7 >= 5.6.3) Random number GMP gmp_random_bits ( integer $bits ) Generate a random number. The number will be between 0 and (2 ** bits) - 1. bits must greater than 0, and the maximum value is restricted by available memory. Parameters: bits The number of bits. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a num

gmp_prob_prime

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Check if number is "probably prime" int gmp_prob_prime ( GMP $a [, int $reps = 10 ] ) The function uses Miller-Rabin's probabilistic test to check if a number is a prime. Parameters: a The number being checked as a prime. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided

gmp_powm

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Raise number into power with modulo GMP gmp_powm ( GMP $base, GMP $exp, GMP $mod ) Calculate (base raised into power exp) modulo mod. If exp is negative, result is undefined. Parameters: base The base number. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is po

gmp_pow

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Raise number into power GMP gmp_pow ( GMP $base, int $exp ) Raise base into power exp. Parameters: base The base number. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. exp The pos

gmp_popcount

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Population count int gmp_popcount ( GMP $a ) Get the population count. Parameters: a Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. Returns: The population count of a, as an integer.

gmp_perfect_square

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Perfect square check bool gmp_perfect_square ( GMP $a ) Check if a number is a perfect square. Parameters: a The number being checked as a perfect square. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.

gmp_or

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Bitwise OR GMP gmp_or ( GMP $a, GMP $b ) Calculates bitwise inclusive OR of two GMP numbers. Parameters: a Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. b Either a GMP number resour

gmp_nextprime

(PHP 5, PHP 7 >= 5.2.0) Find next prime number GMP gmp_nextprime ( int $a ) Find next prime number Parameters: a Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. Returns: Return the next prime number greater than a, as a GMP

gmp_neg

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Negate number GMP gmp_neg ( GMP $a ) Returns the negative value of a number. Parameters: a Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. Returns: Returns -a, as a GMP number.

gmp_mul

(PHP 4 >= 4.0.4, PHP 5, PHP 7) Multiply numbers GMP gmp_mul ( GMP $a, GMP $b ) Multiplies a by b and returns the result. Parameters: a A number that will be multiplied by b. Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. b