Skip to content

Instantly share code, notes, and snippets.

@kazoo04
Created September 11, 2014 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazoo04/75d6cc19052b2131bb07 to your computer and use it in GitHub Desktop.
Save kazoo04/75d6cc19052b2131bb07 to your computer and use it in GitHub Desktop.
XorShift
unsigned long xorshift() {
static unsigned long x=123456789, y=362436069, z=521288629, w=88675123;
unsigned long t;
t = (x ^ (x << 11));
x = y;
y = z;
z = w;
w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
return w;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment