pub struct Prng { /* private fields */ }Expand description
The state of the generator, as pg_prng_state holds it.
Implementations§
Source§impl Prng
impl Prng
Sourcepub fn from_bytes(bytes: [u8; 16]) -> Prng
pub fn from_bytes(bytes: [u8; 16]) -> Prng
pg_prng_strong_seed: the state of 16 random bytes.
Sourcepub fn fseed(fseed: f64) -> Prng
pub fn fseed(fseed: f64) -> Prng
pg_prng_fseed: the state of a seed in the range -1 to 1, as setseed gives it.
Sourcepub fn uint64_range(&mut self, rmin: u64, rmax: u64) -> u64
pub fn uint64_range(&mut self, rmin: u64, rmax: u64) -> u64
pg_prng_uint64_range: a value from rmin to rmax, with the bitmask rejection method.
Sourcepub fn int64_range(&mut self, rmin: i64, rmax: i64) -> i64
pub fn int64_range(&mut self, rmin: i64, rmax: i64) -> i64
pg_prng_int64_range: a value from rmin to rmax.
Sourcepub fn double(&mut self) -> f64
pub fn double(&mut self) -> f64
pg_prng_double: a value from 0 up to but not including 1, with 52 random bits.
Sourcepub fn double_normal(&mut self) -> f64
pub fn double_normal(&mut self) -> f64
pg_prng_double_normal: a value of the standard normal distribution, with the basic Box-Muller transform.
Trait Implementations§
impl Copy for Prng
impl Eq for Prng
impl StructuralPartialEq for Prng
Auto Trait Implementations§
impl Freeze for Prng
impl RefUnwindSafe for Prng
impl Send for Prng
impl Sync for Prng
impl Unpin for Prng
impl UnsafeUnpin for Prng
impl UnwindSafe for Prng
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