Skip to main content

unit_f64

Function unit_f64 

Source
pub fn unit_f64<R: Rng + ?Sized>(rng: &mut R) -> f64
Expand description

Draws a uniform f64 in [0, 1) from one next_u64 call.

Uses the top 52 bits as the mantissa of a float in [1, 2) and subtracts one, so the result is bit-for-bit reproducible on every platform.