Does using ceil or floor, will increase the chances of collision of generated random number in case generateRandomNumber2
Also which function works better so that collision not occurs?
function generateRandomNumber1() {
var rnd = Math.random() * 99999999999;
rnd += '';
rnd = rnd.replace('.', '');
return parseInt(rnd);
};
function generateRandomNumber2() {
var rnd = Math.random() * 99999999999;
return Math.floor(rnd);
};