0
Question about Math.random
How do you get a random number between -100 and +100?
11 Respostas
+ 2
đđąđąđđš đđĄđđČđđ„ yea sure but i am still in the beginning of learning programming.. so i don't understand your answer with random import randint and stuff đ
đ
đ
+ 1
đđąđąđđš đđĄđđČđđ„ Martin Taylor And what about creating a second Math.random and subtract it with the first Math.random? Would it be a legit opportunity?
+ 1
Because I had an exam today and the question was how do u get random numbers between -100 and +100
And my answer was that u could generate a second Math.random and subtract them
+ 1
number = Math.random()*200 - 100;
+ 1
Ohhh ok now i understand, thank you very much, now i realize that my answer in the exam was wrong đ
That makes perfectly sense
And yea sorry i forgot to include the language, thanks for the advise đ Martin Taylor