prng

Crates.ioprng
lib.rsprng
version0.1.1
sourcesrc
created_at2017-08-17 20:05:36.515413
updated_at2017-10-21 22:24:17.173619
descriptionpseudo random number generator
homepagehttps://gitlab.com/nathanfaucett/rs-prng
repositoryhttps://gitlab.com/nathanfaucett/rs-prng.git
max_upload_size
id27920
size8,294
Nathan Faucett (nathanfaucett)

documentation

README

rs-prng

pseudo random number generator

extern crate prng;
extern crate rng_trait;


use rng_trait::Rng;
use prng::Prng;


fn main() {
    // seeds from an address of a local variable
    let mut random = Prng::new();

    // some random unsigned integer
    // random.set_seed(24564764657);

    println!("x = {:?}", random.next()); // usize number between 0 and usize MAX
    println!("y = {:?}", random.next_f32()); // f32 between 0 and 1
    println!("z = {:?}", random.next_f64()); // f64 between 0 and 1
}
Commit count: 40

cargo fmt