Expand description
use tinymt::{TinyMT64, TinyMT64Seed, TinyMT32};
use rand::{Rng, SeedableRng};
// from nondeterministic seed
let mut random = TinyMT64::from_entropy();
let rn = random.gen_range(0.0..1.0);
assert!((0.0..1.0).contains(&rn));
// from deterministic seed (reproduction of random number sequence is possible)
let mut random = TinyMT64::from_seed(TinyMT64Seed::from(0u64));
let rn = random.gen_range(0.0..1.0);
assert!((0.0..1.0).contains(&rn));
This crate is no_std
compatible.
Modules§
Structs§
- TinyM
T32 - tinymt32 internal state vector and parameters
- TinyM
T64 - random TinyMT state vector
- TinyM
T32Seed - TinyM
T64Seed