medium quality random number generator


/ Published in: Java
Save to your folder(s)

From Java Concurrency in practice


Copy this code and paste it in your HTML
  1. static int xorShift(int y) {
  2. y ^= (y << 6);
  3. y ^= (y >>> 21);
  4. y ^= (y << 7);
  5. return y;
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.