Closed gyk closed 5 years ago
These two lines of tempering transform should use left shift: https://github.com/sunoru/RandomNumbers.jl/blob/v1.2.0/src/MersenneTwisters/bases.jl#L77-L78.
As a verification, when seeded with 5489, MT19937 generates a UInt32 sequence of 0xD091BB5C, 0x22AE9EF6, 0xE7E1FAEE, ....
UInt32
0xD091BB5C, 0x22AE9EF6, 0xE7E1FAEE, ...
OMG, you are right!
It was a terribly wrong implementation. I wonder why it could pass the empirical tests...
Fixed.
These two lines of tempering transform should use left shift: https://github.com/sunoru/RandomNumbers.jl/blob/v1.2.0/src/MersenneTwisters/bases.jl#L77-L78.
As a verification, when seeded with 5489, MT19937 generates a
UInt32
sequence of0xD091BB5C, 0x22AE9EF6, 0xE7E1FAEE, ...
.