Skip to main content

Crate unirand

Crate unirand 

Source
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§

MarsagliaUniRng
A struct representing Marsaglia’s Universal Random Number Generator.