minstd 0.9.4

MINSTD minimal standard random number generator
Documentation
/*
MINSTD Multiplicative congruential generator
implementation by Radim Kolar <hsn@sendmail.cz> 2024
https://gitlab.com/hsn10/minstd

This is free and unencumbered software released into the public domain.
SPDX-License-Identifier: Unlicense OR CC0-1.0

For more information, please refer to <http://unlicense.org/>
*/

use super::MINSTD;
use super::SEED;

#[test]
#[ignore]
/**

  Generator period is 2147483646  = 2 ^ 31 - 2
*/
fn compute_period_minstd() {
   let mut counter: u64 = 1;
   let mut maxval = 0;
   let mut g = MINSTD::seed(SEED);
   loop {
      let next = g.next();
      if next > maxval { maxval = next; }
      if next == SEED { break; }
      counter += 1;
   }
   assert_eq! ( maxval, super::MAX, "maximum value doesn't match" );
   panic!("MINSTD generator period is {}, max value {}", counter, maxval);
}