pub fn future(&self, n: u32) -> Rng {
        let a = MULTIPLIER as u64;
        let b = ADDITIVE as u64;
        let m = MODULUS as u64;

        //                          (a^n - 1) mod (a-1) m
        // x_k = ((a^n x_0 mod m) + --------------------- b) mod m
        //                                   a - 1
        //
        // Since (a - 1) divides (a^n - 1) mod (a-1) m,
        // the subtraction does not overflow and thus can be non-modular.
        //
        let new_seed =
            (powmod(a, n, m) * self.last as u64) % m +
            (powmod(a, n, (a-1) * m) - 1) / (a-1) * b;

        Rng { last: (new_seed % m) as u32 }
    }
// This allows us to fast-forward the RNG,
// allowing us to run it in parallel.
This allows us to fast-forward the RNG,
allowing us to run it in parallel.
This allows us to fast - forward the RNG allowing us to run it in parallel .
pub fn future(&self, n: u32) -> Rng {
        let a = MULTIPLIER as u64;
        let b = ADDITIVE as u64;
        let m = MODULUS as u64;
        //                          (a^n - 1) mod (a-1) m
        // x_k = ((a^n x_0 mod m) + --------------------- b) mod m
        //                                   a - 1
        //
        // Since (a - 1) divides (a^n - 1) mod (a-1) m,
        // the subtraction does not overflow and thus can be non-modular.
        //
        let new_seed =
            (powmod(a, n, m) * self.last as u64) % m +
            (powmod(a, n, (a-1) * m) - 1) / (a-1) * b;
        Rng { last: (new_seed % m) as u32 }
    }
pub fn future ( & self , n : u32 ) -> Rng { let a = MULTIPLIER as u64 ; let b = ADDITIVE as u64 ; let m = MODULUS as u64 ; //                          (a^n - 1) mod (a-1) m // x_k = ((a^n x_0 mod m) + --------------------- b) mod m //                                   a - 1 // // Since (a - 1) divides (a^n - 1) mod (a-1) m, // the subtraction does not overflow and thus can be non-modular. // let new_seed = ( powmod ( a , n , m ) * self . last as u64 ) % m + ( powmod ( a , n , ( a - 1 ) * m ) - 1 ) / ( a - 1 ) * b ; Rng { last : ( new_seed % m ) as u32 } }
This allows us to fast-forward the RNG,
allowing us to run it in parallel.
This allows us to fast - forward the RNG allowing us to run it in parallel .
&self
n
u32