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

Solve each proportion for the missing variable. Please solve this and show your work please! A) 15/25 = 10/p
a cylinder has a height of 50 cm and a diameter of 10 cm calculate the surface area of the cylinder if it is closed​
A rocket is launched from a tower. The height of the rocket, y in feet, is related to the time after launch, x in second, by the given equation. Using this equa
please please please please
Express the terms of the following sequence by giving an explicit formula. 5 , 2 , -1 , -4, -7 , .
The box plots show the weights, in pounds, of the dogs in two different animal shelters. Weights of Dogs in Shelter A 2 box plots. The number line goes from 6 t
mention 8 causes of cancer​
did you mom ever yell at you
Solve for x. (have to add extra letters so the question works)PLEASE ADD STEPS AND EXPLAIN IT IN ANY WAY POSSIBLE SO I CAN LEARN
I need help please, i dont understand