Set modulus, multiplier, and increment. Initialize rand_state according to Date.now().
ReadonlyincrementReadonlymodulusReadonlymultiplierGenerate the next integer in the range (0, this.modulus) non-inclusive, updating rand_state.
Postcondition: pass checkRandState(), i.e. rand_state > 0 and is an integer.
Generates random float between (0, 1) non-inclusive, updating rand_state.
Postcondition: pass checkRandState(), i.e. rand_state > 0 and is an integer.
Sets rand_state after normalized with modulus to ensure that it is within range.
Any integer. Used to set rand_state after normalized with modulus.
Postcondition: pass checkRandState(), i.e. rand_state > 0 and is an integer.
Linear congruential generator for random number generating that can be seeded.
Follows the implementation of
include/tvm/support/random_engine.h, which follows the sepcification in https://en.cppreference.com/w/cpp/numeric/random/linear_congruential_engine.Note
Number.MAX_SAFE_INTEGER = 2^53 - 1, and our intermediates are strictly less than 2^48.