Macro rand_simple::create_uniform
source · macro_rules! create_uniform { () => { ... }; ($seed: expr) => { ... }; }
Expand description
一様分布のインスタンスを生成するマクロ
() =>- 乱数の種は自動生成($seed: expr) =>- 乱数の種を指定する
使用例 1
let uniform = rand_simple::create_uniform!(1192u32);
assert_eq!(uniform.sample(), 0.8512317447111084f64);使用例 2
let uniform = rand_simple::create_uniform!();
println!("乱数: {}", uniform.sample()); // インスタンス生成時刻に依存するため、コンパイル時は値不明