ganesh

Trait SampleFloat

Source
pub trait SampleFloat {
    // Required methods
    fn range(&mut self, lower: Float, upper: Float) -> Float;
    fn float(&mut self) -> Float;
    fn normal(&mut self, mu: Float, sigma: Float) -> Float;
}
Expand description

A helper trait to get feature-gated floating-point random values

Required Methods§

Source

fn range(&mut self, lower: Float, upper: Float) -> Float

Get a random value in a range

Source

fn float(&mut self) -> Float

Get a random value in the range [0, 1]

Source

fn normal(&mut self, mu: Float, sigma: Float) -> Float

Get a random Normal value

Implementations on Foreign Types§

Source§

impl SampleFloat for Rng

Source§

fn range(&mut self, lower: Float, upper: Float) -> Float

Source§

fn float(&mut self) -> Float

Source§

fn normal(&mut self, mu: Float, sigma: Float) -> Float

Implementors§