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.
78 public static random(): number { 79 return math.random(); 80 }
10 function math_random_int(a, b) { 11 if (a > b) { 12 // Swap a and b to ensure a is smaller. 13 var c = a; 14 a = b; 15 b = c; 16 } 17 return Math.floor(Math.random() * (b - a + 1) + a); 18 }
14 function random(max) { 15 var rand = Math.floor(Math.random() * max); 16 return rand; 17 }
14 function randomBetween(min, max, round) { 15 const num = Math.random() * (max - min + 1) + min 16 17 if (round) { 18 return Math.floor(num) 19 } 20 return num 21 }
3 function _random(max) { 4 return Math.round(Math.random()*1000)%max 5 }
19 function _random(max) { 20 return Math.round(Math.random() * 1000) % max; 21 }
1 function _random(max) { 2 return Math.round(Math.random()*1000)%max; 3 }
51 function random(from, to) { 52 return Math.floor(Math.random() * (to - from + 1) + from); 53 }
270 function random(max, min) { 271 return Math.round(Math.random() * (max - min) + min); 272 }
190 function MathRand() { 191 var myDate = new Date(); 192 var mytime = myDate.getTime(); 193 var Num = ""; 194 for (var i = 0; i < 6; i++) { 195 Num += Math.floor(Math.random() * 10); 196 } 197 Num = Num + "-" + mytime; 198 return Num; 199 };