[][src]Struct rand::distributions::StandardNormal

pub struct StandardNormal;

Samples floating-point numbers according to the normal distribution N(0, 1) (a.k.a. a standard normal, or Gaussian). This is equivalent to Normal::new(0.0, 1.0) but faster.

See Normal for the general normal distribution.

Implemented via the ZIGNOR variant1 of the Ziggurat method.

Example

use rand::prelude::*;
use rand::distributions::StandardNormal;

let val: f64 = SmallRng::from_entropy().sample(StandardNormal);
println!("{}", val);

  1. Jurgen A. Doornik (2005). An Improved Ziggurat Method to Generate Normal Random Samples. Nuffield College, Oxford 

Trait Implementations

impl Distribution<f64> for StandardNormal
[src]

Important traits for DistIter<'a, D, R, T>
fn sample_iter<'a, R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
    Self: Sized,
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl Clone for StandardNormal
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for StandardNormal
[src]

impl Debug for StandardNormal
[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]