rand.js
374 Bytes
var random = require('./random');
var MIN_INT = require('../number/MIN_INT');
var MAX_INT = require('../number/MAX_INT');
/**
* Returns random number inside range
*/
function rand(min, max){
min = min == null? MIN_INT : min;
max = max == null? MAX_INT : max;
return min + (max - min) * random();
}
module.exports = rand;