Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Question about Math.random
How do you get a random number between -100 and +100?
5 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