Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
MT19937 backended pseudo random number generator. More...
Go to the source code of this file.
Functions | |
unsigned int | rb_genrand_int32 (void) |
double | rb_genrand_real (void) |
void | rb_reset_random_seed (void) |
VALUE | rb_random_bytes (VALUE rnd, long n) |
VALUE | rb_random_int (VALUE rnd, VALUE max) |
unsigned int | rb_random_int32 (VALUE rnd) |
double | rb_random_real (VALUE rnd) |
unsigned long | rb_random_ulong_limited (VALUE rnd, unsigned long limit) |
unsigned long | rb_genrand_ulong_limited (unsigned long i) |
MT19937 backended pseudo random number generator.
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file random.h.
unsigned int rb_genrand_int32 | ( | void | ) |
Definition at line 189 of file random.c.
References rb_random_mt_t::mt.
double rb_genrand_real | ( | void | ) |
Definition at line 196 of file random.c.
References rb_random_mt_t::mt.
Definition at line 975 of file random.c.
References rb_random_mt_t::base.
double rb_random_real | ( | VALUE | rnd | ) |
Definition at line 1047 of file random.c.
References NUM2DBL, rb_eRangeError, rb_funcallv, rb_raise(), and TRUE.
Definition at line 1107 of file random.c.
References NUM2ULONG, rb_eRangeError, rb_funcallv_public(), rb_num_negative_p(), rb_raise(), and rb_to_int().
void rb_reset_random_seed | ( | void | ) |
Definition at line 1664 of file random.c.
References rb_random_mt_t::base, INT2FIX, rb_random_mt_t::mt, rb_random_struct::seed, and uninit_genrand.