php man page for gmp_random_range

Query: gmp_random_range

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

GMP_RANDOM_RANGE(3)							 1						       GMP_RANDOM_RANGE(3)

gmp_random_range - Random number

SYNOPSIS
GMP gmp_random_range (GMP $min, GMP $max)
DESCRIPTION
Generate a random number. The number will be between $min and $max. $min and $max can both be negative but $min must always be less than $max.
PARAMETERS
o $min - A GMP number representing the lower bound for the random number o $max - A GMP number representing the upper bound for the random number
RETURN VALUES
A random GMP number.
EXAMPLES
Example #1 gmp_random_range(3) example <?php $rand1 = gmp_random_range(0, 100); // random number between 0 and 100 $rand2 = gmp_random_range(-100, -10); // random number between -100 and -10 echo gmp_strval($rand1) . " "; echo gmp_strval($rand2) . " "; ?> The above example will output: 42 -67 PHP Documentation Group GMP_RANDOM_RANGE(3)
Related Man Pages
gmp_clrbit(3) - php
gmp_hamdist(3) - php
gmp_random(3) - php
gmp_setbit(3) - php
math::gmp(3pm) - debian
Similar Topics in the Unix Linux Community
Forum Video Tutorial: How to Use Code Tags
New Code Tags (Syntax Highlighting)
Please Welcome Don Cragun as Lead Moderator
Please Welcome Ravinder Singh to the Moderation Team
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Don Cragun