GNU Info

Info Node: (gmp.info)Random Number Functions

(gmp.info)Random Number Functions


Next: Formatted Output Prev: Low-level Functions Up: Top
Enter node , (file) or (file)node

Random Number Functions
***********************

   Sequences of pseudo-random numbers in GMP are generated using a
variable of type `gmp_randstate_t', which holds an algorithm selection
and a current state.  Such a variable must be initialized by a call to
one of the `gmp_randinit' functions, and can be seeded with one of the
`gmp_randseed' functions.

   The functions actually generating random numbers are described in
Note: Integer Random Numbers, and Note: Miscellaneous Float
Functions.

   The older style random number functions don't accept a
`gmp_randstate_t' parameter but instead share a global variable of that
type.  They use a default algorithm and are currently not seeded
(though perhaps that will change in the future).  The new functions
accepting a `gmp_randstate_t' are recommended for applications that
care about randomness.

Random State Initialization
Random State Seeding

automatically generated by info2www version 1.2.2.9