Expand description
§Unirand Crate
This crate implements Marsaglia’s Universal Random Number Generator. More details on the original paper.
§Overview
The RNG uses a sequence of operations to generate uniformly distributed random numbers between 0 and 1. It has been designed with simplicity and reproducibility in mind.
§Usage Instructions
To use this crate, add the following dependency to your Cargo.toml:
[dependencies]
unirand = "0.2.0"Then, you can initialise and use the RNG in your project as follows:
use unirand::MarsagliaUniRng;
let mut rng = MarsagliaUniRng::new();
rng.rinit(170);
println!("Random number: {}", rng.uni());§Further Information
See the documentation for individual functions and methods below for more details.
Structs§
- Marsaglia
UniRng - A struct representing Marsaglia’s Universal Random Number Generator.