|4.0.1||Feb 25, 2021|
|3.0.0||Mar 18, 2020|
|2.0.0||Mar 15, 2020|
#109 in Algorithms
143 downloads per month
Used in palette
Implemenents a selection of Mersenne Twister random number generators.
A very fast random number generator of period 219937-1. (Makoto Matsumoto, 1997).
This crate optionally depends on rand_core and implements
RngCore on the
RNGs in this crate.
Add this to your
[dependencies] rand_mt = "4"
Then create a RNG like:
use rand_mt::Mt64; let mut rng = Mt64::new_unseeded(); assert_ne!(rng.next_u64(), rng.next_u64());
rand_mt has several optional features that
are enabled by default:
- rand-traits - Enables a dependency on
rand_core. Activating this feature implements
SeedableRngon the RNGs in this crate.
- std - Enables a dependency on the Rust Standard Library. Activating this
std::error::Errorimpls on error types in this crate.
Mersenne Twister requires ~2.5KB of internal state. To make the RNGs implemented
in this crate practical to embed in other structs, you may wish to store the RNG
This crate requires at least Rust 1.47.0. This version can be bumped in minor releases.
rand_mt is derived from
1.1.1 which is Copyright
(c) 2015 rust-mersenne-twister developers.