fn radical_inverse_specialized(base: u16, a: u64) -> Float {
    let inv_base: Float = 1.0 as Float / base as Float;
    let mut reversed_digits: u64 = 0_u64;
    let mut inv_base_n: Float = 1.0 as Float;
    let mut a: u64 = a; // shadowing input parameter
    while a != 0_u64 {
        let next: u64 = a / base as u64;
        let digit: u64 = a - next * base as u64;
        reversed_digits = reversed_digits * base as u64 + digit;
        inv_base_n *= inv_base;
        a = next;
    }
    assert!(reversed_digits as Float * inv_base_n < 1.00001 as Float);
    (reversed_digits as Float * inv_base_n).min(FLOAT_ONE_MINUS_EPSILON)
}
/// Once we have an appropriate prime number, use it to compute the
/// radical inverse.
Once we have an appropriate prime number, use it to compute the
radical inverse.
Once we have an appropriate prime number use it to compute the radical inverse .
fn radical_inverse_specialized(base: u16, a: u64) -> Float {
    let inv_base: Float = 1.0 as Float / base as Float;
    let mut reversed_digits: u64 = 0_u64;
    let mut inv_base_n: Float = 1.0 as Float;
    let mut a: u64 = a; // shadowing input parameter
    while a != 0_u64 {
        let next: u64 = a / base as u64;
        let digit: u64 = a - next * base as u64;
        reversed_digits = reversed_digits * base as u64 + digit;
        inv_base_n *= inv_base;
        a = next;
    }
    assert!(reversed_digits as Float * inv_base_n < 1.00001 as Float);
    (reversed_digits as Float * inv_base_n).min(FLOAT_ONE_MINUS_EPSILON)
}
fn radical_inverse_specialized ( base : u16 , a : u64 ) -> Float { let inv_base : Float = 1.0 as Float / base as Float ; let mut reversed_digits : u64 = 0_u64 ; let mut inv_base_n : Float = 1.0 as Float ; let mut a : u64 = a ; // shadowing input parameter while a != 0_u64 { let next : u64 = a / base as u64 ; let digit : u64 = a - next * base as u64 ; reversed_digits = reversed_digits * base as u64 + digit ; inv_base_n *= inv_base ; a = next ; } assert ! ( reversed_digits as Float inv_base_n 1.00001 as Float ) ; ( reversed_digits as Float * inv_base_n ) . min ( FLOAT_ONE_MINUS_EPSILON ) }
Once we have an appropriate prime number, use it to compute the
radical inverse.
Once we have an appropriate prime number use it to compute the radical inverse .
base
u16
a
u64