estradaangelic80
estradaangelic80 estradaangelic80
  • 12-11-2020
  • Computers and Technology
contestada

Why does the randomNumber function only use whole numbers between 0 and 1 (basically, 0 and 1)?

Respuesta :

b1nary
b1nary b1nary
  • 12-11-2020

Answer:

The randomNumber function only uses whole numbers between 0 and 1 because those are the unspecified minimum and maximums to get random numbers. If you want a larger range, just specify the minimum and maximum.

Explanation:

Example code on how to specify a larger range, replace max and min with your maximum and minimum integers.

function getRandomArbitrary(min, max) {

 return Math.random() * (max - min) + min;

}

Answer Link

Otras preguntas

If the process illustrated in the diagram is interrupted by a chemical at point X, there would be an immediate effect on the release of (1) chlorophyll (2
if a triangle has a height of 12 inches in the base of 5 inches what is the area
what is 1284 rounded to the nearest 100?
Why were elaborate tombs so important to pharaohs as well as everyday Egyptians?
What times 3 equals 62
Which phase of the writing process involves checking the content to see if the essay is sufficiently detailed and adequately supports the thesis statement? draf
Two different ways to find the difference for 12-3
first free settlement of africans in America
Judging from the history of sumer,what geographic conditions would help other ancient civilizations to develop?I need answers fast please!!!!
Which process could a forensic scientist use to analyze a DNA sample from a crime scene to identify a criminal?