Class XorShift64

java.lang.Object
io.github.olyutorskii.aletojio.rng.xorsft.XorShift64
All Implemented Interfaces:
RndInt64

public class XorShift64 extends Object implements RndInt64
xorshift (64bit) Pseudo Random Generator.
See Also:
  • Constructor Details

    • XorShift64

      public XorShift64()
      Constructor.
  • Method Details

    • nextInt64

      public long nextInt64()
      Return next random number as 64bit long with random sign-bit.
      Specified by:
      nextInt64 in interface RndInt64
      Returns:
      random number
    • setSeed

      public void setSeed(long seedArg)
      Set seed.

      Seed must be non-zero.

      Parameters:
      seedArg - seed
      Throws:
      IllegalArgumentException - Seed must be non-zero