lundi 2 août 2021

Why did they use 101 instead of 100? with Math.random()?

I just started learning java through w3schools and one of the methods(?) was Math.random() and they had this example:

enter image description here

I am not quite sure why they've done Math.random() * 101. Why did they use 101 instead of 100?

Thank you




Aucun commentaire:

Enregistrer un commentaire