Struct rand_simple::Normal
source · pub struct Normal { /* private fields */ }Expand description
正規分布を計算する構造体
使用例 1 (new関数)
use rand_simple::Normal;
let normal = Normal::new(1192u32, 765u32);
let next = normal.sample(); // 平均値 0, 標準偏差 1 の標準正規分布
println!("乱数: {}", next); // -1.2296205447119757使用例 2 (マクロ・引数有り)
use rand_simple::create_normal;
let create_normal = create_normal!(1192u32, 765u32);
let next = create_normal.sample(); // 平均値 0, 標準偏差 1 の標準正規分布
println!("乱数: {}", next); // -1.2296205447119757使用例 3 (マクロ・引数無し)
use rand_simple::create_normal;
let create_normal = create_normal!();
let next = create_normal.sample(); // 平均値 0, 標準偏差 1 の標準正規分布
println!("乱数: {}", next); // 値不明Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Normal
impl Send for Normal
impl !Sync for Normal
impl Unpin for Normal
impl UnwindSafe for Normal
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more