tvmjs
    Preparing search index...

    Class LinearCongruentialGenerator

    Index
    increment: number
    modulus: number
    multiplier: number
    • Get the current generator state for deterministic restoration.

      Returns number

    • Generate the next integer in the range (0, this.modulus) non-inclusive, updating rand_state.

      Postcondition: pass checkRandState(), i.e. rand_state > 0 and is an integer.

      Returns number

    • Generates random float between (0, 1) non-inclusive, updating rand_state.

      Postcondition: pass checkRandState(), i.e. rand_state > 0 and is an integer.

      Returns number

    • Sets rand_state after normalized with modulus to ensure that it is within range.

      Parameters

      • seed: number

        Any integer. Used to set rand_state after normalized with modulus.

        Postcondition: pass checkRandState(), i.e. rand_state > 0 and is an integer.

      Returns void

    • Restore a state returned by getState().

      Parameters

      • state: number

      Returns void