Package fj

Class LcgRng


public class LcgRng extends Rng
https://en.wikipedia.org/wiki/Linear_congruential_generator
  • Field Details

    • seed

      private final Long seed
  • Constructor Details

    • LcgRng

      public LcgRng()
    • LcgRng

      public LcgRng(long s)
  • Method Details

    • getSeed

      public final long getSeed()
    • nextInt

      public final P2<Rng,Integer> nextInt()
      Specified by:
      nextInt in class Rng
    • nextLong

      public final P2<Rng,Long> nextLong()
      Specified by:
      nextLong in class Rng
    • nextLong

      static P2<Long,Long> nextLong(long seed)
      Parameters:
      seed -
      Returns:
      Product of Seed and value