Node.js examples for Number:Random Number
Get Normal Distributed Random
function getNormalDistributedRandom ( min, max ) { var res = ( getRandom( min, max ) + getRandom( min, max ) + getRandom( min, max ) ) / 3; return res;//from www. j av a 2s . c om } function getRandom ( min, max ) { var res = Math.random(); // uniform random distributed in [0, 1) res = min + (max - min)*res; return res; }