Crates.io | rand_num_gen |
lib.rs | rand_num_gen |
version | 0.1.0 |
source | src |
created_at | 2017-11-04 04:51:26.798926 |
updated_at | 2017-11-04 04:51:26.798926 |
description | random number generator trait |
homepage | https://gitlab.com/nathanfaucett/rs-rand_num_gen |
repository | https://gitlab.com/nathanfaucett/rs-rand_num_gen.git |
max_upload_size | |
id | 38091 |
size | 3,166,834 |
random number generator
extern crate rand_num_gen;
use rand_num_gen::{Rng, XorShift};
fn main() {
let mut rng = XorShift::new();
let x: f32 = rng.next();
let y = rng.next_u32();
let z = rng.next_usize();
let w = rng.next_f64();
println!("{:?} {:?} {:?} {:?}", x, y, z, w);
}