Every line of 'math.floor(math.random()' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
21 export function randomInt(min, max){ 22 return Math.ceil( min - 0.5 + (Math.random() * max)); 23 }
8 function randomInt () { 9 return Math.round(Math.random() * 255) 10 }
46 function randomInt(max) { 47 return Math.ceil(Math.random() * max) 48 }
5 static randomInt() { 6 return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); 7 }
55 function getrand(min, max){ 56 return Math.floor(Math.random()*(max-min+1)+min); 57 }
82 export function randomInt(min, max) { 83 min = Math.ceil(min) 84 max = Math.floor(max) 85 return Math.floor(Math.random() * (max - min)) + min 86 }
66 function randomInt (min,max) { return Math.floor(Math.random() * (max - min + 1) + min); }
358 function randomInt(min, max) { 359 return Math.floor(Math.random() * (max - min + 1) + min); 360 }
110 function randomInt(min, max) { 111 if (!min) { 112 min = RAND_MIN; 113 } 114 115 if (!max) { 116 max = RAND_MAX; 117 } 118 119 return Math.floor(min + (1 + max - min) * Math.random()); 120 }
15 export function getRandomInt(min = 0, max = 100) { 16 min = Math.ceil(min); 17 max = Math.floor(max); 18 return Math.floor(Math.random() * (max - min + 1)) + min; 19 }