PATH:
usr
/
local
/
lib
/
node_modules
/
bower
/
lib
/
node_modules
/
bower-config
/
node_modules
/
mout
/
random
var MIN_INT = require('../number/MIN_INT'); var MAX_INT = require('../number/MAX_INT'); var rand = require('./rand'); /** * Gets random integer inside range or snap to min/max values. */ function randInt(min, max){ min = min == null? MIN_INT : ~~min; max = max == null? MAX_INT : ~~max; // can't be max + 0.5 otherwise it will round up if `rand` // returns `max` causing it to overflow range. // -0.5 and + 0.49 are required to avoid bias caused by rounding return Math.round( rand(min - 0.5, max + 0.499999999999) ); } module.exports = randInt;
[-] randBit.js
[edit]
[-] randString.js
[edit]
[-] randBool.js
[edit]
[+]
..
[-] randSign.js
[edit]
[-] random.js
[edit]
[-] randInt.js
[edit]
[-] randHex.js
[edit]
[-] rand.js
[edit]
[-] choice.js
[edit]
[-] guid.js
[edit]