pub struct Open01<F>(pub F);
Expand description
A wrapper for generating floating point numbers uniformly in the
open interval (0,1)
(not including either endpoint).
Use Closed01
for the closed interval [0,1]
, and the default
Rand
implementation for f32
and f64
for the half-open
[0,1)
.
Example
use sgx_rand::{random, Open01};
let Open01(val) = random::<Open01<f32>>();
println!("f32 from (0,1): {}", val);
Tuple Fields
0: F
Trait Implementations
Auto Trait Implementations
impl<F> RefUnwindSafe for Open01<F>where
F: RefUnwindSafe,
impl<F> Send for Open01<F>where
F: Send,
impl<F> Sync for Open01<F>where
F: Sync,
impl<F> Unpin for Open01<F>where
F: Unpin,
impl<F> UnwindSafe for Open01<F>where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more