Skip to main content
CrystalDocs
Search documentation
Search
Browse Docs
CrystalShards
About
class
Ruby::V4::MT19937
Inherits
Reference
<
Object
Constants
LOWER_MASK = 2147483647_u32
M = 397
MATRIX_A = 2567483615_u32
N = 624
UPPER_MASK = 2147483648_u32
Constructors
new
Source
Instance methods
init_by_array
(key :
Array
(
UInt32
))
Source
init_genrand
(s :
UInt32
)
Source
next_u32
Source
seed
(seed :
Int
)
Сидирование как rand_init в random.c Ruby:
|seed| помещается в uint32 → init_genrand(seed);
иначе init_by_array словами little-endian, при этом последнее слово, равное 1, отбрасывается (remove leading-zero-guard).
Source