MCPcopy Create free account
hub / github.com/corbanbrook/dsp.js / nextInt

Function nextInt

examples/js/processing.js:5736–5740  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5734 // from http://www.math.uni-bielefeld.de/~sillke/ALGORITHMS/random/marsaglia-c
5735 var z=i1 || 362436069, w= i2 || 521288629;
5736 var nextInt = function() {
5737 z=(36969*(z&65535)+(z>>>16)) & 0xFFFFFFFF;
5738 w=(18000*(w&65535)+(w>>>16)) & 0xFFFFFFFF;
5739 return (((z&0xFFFF)<<16) | (w&0xFFFF)) & 0xFFFFFFFF;
5740 };
5741
5742 this.nextDouble = function() {
5743 var i = nextInt() / 4294967296;

Callers 1

MarsagliaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected