gmp_libgmp_urandomm_ui Method |
Namespace: Math.Gmp.Native
public static uint gmp_urandomm_ui( gmp_randstate_t state, uint n )
Public Shared Function gmp_urandomm_ui ( state As gmp_randstate_t, n As UInteger ) As UInteger
public: static unsigned int gmp_urandomm_ui( gmp_randstate_t^ state, unsigned int n )
static member gmp_urandomm_ui : state : gmp_randstate_t * n : uint32 -> uint32
// Create, initialize, and seed a new random number generator. gmp_randstate_t state = new gmp_randstate_t(); gmp_lib.gmp_randinit_mt(state); gmp_lib.gmp_randseed_ui(state, 1000U); // Generate a random integer in the range [0, 8-1]. uint rand = gmp_lib.gmp_urandomm_ui(state, 8); // Free all memory occupied by state. gmp_lib.gmp_randclear(state);
' Create, initialize, and seed a new random number generator. Dim state As New gmp_randstate_t() gmp_lib.gmp_randinit_mt(state) gmp_lib.gmp_randseed_ui(state, 1000UI) ' Generate a random integer in the range [0, 8-1]. Dim rand As UInteger = gmp_lib.gmp_urandomm_ui(state, 8) ' Free all memory occupied by state. gmp_lib.gmp_randclear(state)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.