1.0.2 • Published 10 years ago

rand31 v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

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.

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago