Skip to content

Instantly share code, notes, and snippets.

@javascripter
Created December 6, 2009 04:00
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 javascripter/250042 to your computer and use it in GitHub Desktop.
Save javascripter/250042 to your computer and use it in GitHub Desktop.
var srand, rand;
(function () {
const a = 16807, b = 0, m = 2147483647;
var x = 1;
srand = function (seed) {
x = seed;
};
rand = function () {
x = (a * x + b) % m;
return x;
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment