pub struct Rng { /* private fields */ }Implementations§
Source§impl Rng
impl Rng
pub fn seed_from(seed: u64) -> Self
Sourcepub fn below(&mut self, n: u32) -> u32
pub fn below(&mut self, n: u32) -> u32
Uniform in 0..n. Modulo bias is negligible for the small n used here.
Sourcepub fn normal(&mut self, mu: f64, sigma: f64) -> f64
pub fn normal(&mut self, mu: f64, sigma: f64) -> f64
Gaussian via Box–Muller. Same-build reproducible (the determinism bar the architecture commits to); not bit-portable across compilers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rng
impl RefUnwindSafe for Rng
impl Send for Rng
impl Sync for Rng
impl Unpin for Rng
impl UnsafeUnpin for Rng
impl UnwindSafe for Rng
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