// Copied from `rand` with minor modifications.
Copied from `rand` with minor modifications.
Copied from ` rand ` with minor modifications .
fn sample(value: u64) -> f64 {
    let fraction_bits = 52;
    // Multiply-based method; 24/53 random bits; [0, 1) interval.
    // We use the most significant bits because for simple RNGs
    // those are usually more random.
    let float_size = std::mem::size_of::<f64>() as u32 * 8;
    let precision = fraction_bits + 1;
    let scale = 1.0 / ((1_u64 << precision) as f64);
    let value = value >> (float_size - precision);
    scale * (value as f64)
}
fn sample ( value : u64 ) -> f64 { let fraction_bits = 52 ; // Multiply-based method; 24/53 random bits; [0, 1) interval. // We use the most significant bits because for simple RNGs // those are usually more random. let float_size = std :: mem :: size_of :: < f64 > ( ) as u32 * 8 ; let precision = fraction_bits + 1 ; let scale = 1.0 / ( ( 1_u64 << precision ) as f64 ) ; let value = value >> ( float_size - precision ) ; scale * ( value as f64 ) }
Copied from `rand` with minor modifications.
Copied from ` rand ` with minor modifications .
value
u64