rand31
v1.0.2
Published
Park-Miller Pseudo-Random Number Generator
Downloads
2
Readme
rand31
JS port of Park-Miller-Carta Pseudo-Random Number Generator
Full description available at http://www.firstpr.com.au/dsp/rand31/
Usage
var Random = require('rand31');
var r = new Random(42);
var number = r.nextInt();
Methods
rand31.seed(value) - Setup new seed for generator.
rand31.next() - Get next random number. rand31.nextInt(min, max) - Get next random rounded number. rand31.nextDouble(min, max) - Get next random float number.
For nextInt adn nextDouble both arguments can be omitted. In this case value from 0 to 2^46 will be returned. In case second argument is omitted value from 0 to first argument will be returned.