Answers for "node random numbers"

6

javascript random number in range

function getRandomIntInclusive(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive 
}
Posted by: Guest on January-27-2020
0

javascript pseudo random

var seed = 0;
var modulus = 2 ** 32;
var a = 1664525;
var c = 1013904223;

function getRandom() {
  var returnVal = seed / modulus;
  seed = (a * seed + c) % modulus;
  return returnVal;
}
Posted by: Guest on June-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language