PHP gmp_random_bits() functionThe PHP gmp_random_bits() function creates a random value or number of the given input GMP number. This function uses equation to find random number which is the "(2 * $input_num) - 1". The $input_num data must be greater than 0. The maximum number of input data depends on the memory size. SyntaxThe given syntax shows the GMP function for creating random values of the bit. Parameters
Return ValueThe function shows output in numerical format to generate a random value or bits of the given input value. ExamplesExample1: the given example generates "random bits" of the given single positive input value. Output: The following output identifies the random bits of the given value. Example2: The given example shows random bits of the given variable. Output: The following output identifies the random bits of the given value. Example3: The given example creates random bits of the given variable. Output: The following output identifies the random bits of the given value. ConclusionThe gmp_random_bits() function shows the random bits of the input number. This function works on the complicated mathematical operation.
Next TopicPHP gmp_random_range() function
|