Original source of `(seed * 9301 + 49297) % 233280` random algorithm?
source link: https://softwareengineering.stackexchange.com/questions/260969/original-source-of-seed-9301-49297-233280-random-algorithm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Original source of `(seed * 9301 + 49297) % 233280` random algorithm?
If you search for examples of creating a seeded (pseudo)Random number generator, you will run into stuff like this (specific example http://indiegamr.com/generate-repeatable-random-numbers-in-js/):
// the initial seed
Math.seed = 6;
// in order to work 'Math.seed' must NOT be undefined,
// so in any case, you HAVE to provide a Math.seed
Math.seededRandom = function(max, min) {
max = max || 1;
min = min || 0;
Math.seed = (Math.seed * 9301 + 49297) % 233280;
var rnd = Math.seed / 233280;
return min + rnd * (max - min);
}
Those specific numbers (9301, 49297, 233280) and algorithm are used over and over, but nobody seems to have a definitive reference for this. Who invented this algorithm and tested the distribution? Is there a paper or something to cite?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK