typedef typedefG_BEGIN_DECLS struct _GRand | GRand |
g_rand_new_with_seed: : a value to initialize the random number generator.
Creates a new random number generator initialized with .
Return value: the new GRand.
g_rand_new_with_seed_array: : an array of seeds to initialize the random number generator. : an array of seeds to initialize the random number generator.
Creates a new random number generator initialized with .
Return value: the new GRand.
Since: 2.4
IMPORT_C GRand * | g_rand_new | ( | void | ) |
g_rand_new:
Creates a new random number generator initialized with a seed taken either from <filename>/dev/urandom</filename> (if existing) or from the current time (as a fallback).
Return value: the new GRand.
IMPORT_C void | g_rand_free | ( | GRand * | rand_ | ) |
g_rand_copy: : a GRand.
Copies a GRand into a new one with the same exact state as before. This way you can take a snapshot of the random number generator for replaying later.
Return value: the new GRand.
Since: 2.4
g_rand_set_seed: : a GRand. : a value to reinitialize the random number generator.
Sets the seed for the random number generator GRand to .
g_rand_set_seed_array: : a GRand. : array to initialize with : length of array
Initializes the random number generator by an array of longs. Array can be of arbitrary size, though only the first 624 values are taken. This function is useful if you have many low entropy seeds, or if you require more then 32bits of actual entropy for your application.
Since: 2.4
g_rand_int: : a GRand.
Returns the next random guint32 from equally distributed over the range [0..2^32-1].
Return value: A random number.
g_rand_int_range: : a GRand. : lower closed bound of the interval. : upper open bound of the interval.
Returns the next random gint32 from equally distributed over the range [..-1].
Return value: A random number.
g_rand_double: : a GRand.
Returns the next random gdouble from equally distributed over the range [0..1).
Return value: A random number.
g_rand_double_range: : a GRand. : lower closed bound of the interval. : upper open bound of the interval.
Returns the next random gdouble from equally distributed over the range [..).
Return value: A random number.
IMPORT_C void | g_random_set_seed | ( | guint32 | seed | ) |
g_random_set_seed: : a value to reinitialize the global random number generator.
Sets the seed for the global random number generator, which is used by the <function>g_random_*</function> functions, to .
IMPORT_C guint32 | g_random_int | ( | void | ) |
g_random_int:
Return a random guint32 equally distributed over the range [0..2^32-1].
Return value: A random number.
g_random_int_range: : lower closed bound of the interval. : upper open bound of the interval.
Returns a random gint32 equally distributed over the range [..-1].
Return value: A random number.