rand31

1.0.2 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i rand31

Weekly Downloads

4

Version

1.0.2

License

MIT

Last publish

Collaborators

  • siranthony