[Documentation]: Question about Math.random().
See original GitHub issueMDN - Math.random() says the function returns a a floating-point number in the range 0 to less than 1 (inclusive of 0, but not 1), MDN doesn’t describe in math expression.
I am not sure it make sense or better, change a random value [0-1]
to a random value [0-1)
, a random value [0~1)
or a random value [0,1)
.
How about Sets the x and y components of this vector to a random value in the range 0 to less than 1 (inclusive of 0, but not 1)
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Math.random() - JavaScript - MDN Web Docs
The Math.random() function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform ...
Read more >Java Math random() method with Examples - GeeksforGeeks
The java.lang.Math.random() method returns a pseudorandom double type number greater than or equal to 0.0 and less than 1.0. . When this method ......
Read more >Java Math.random() Method with Examples - Javatpoint
Math.random() is used to return a pseudorandom double type number greater than or equal to 0.0 and less than 1.0. The default random...
Read more >how does Math.floor(Math.random()*2) work??? & question on ...
Math.random() * 2 returns any number (including decimal values) between 0(inclusive) and 2(exclusive). Now, when you compute Math.floor() on these values, ...
Read more >JavaScript Math random() Method - W3Schools
The Math.random() method returns a random number from 0 (inclusive) up to but not including 1 (exclusive). Note. Math.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wouldn’t think mathematicians are the target users of the library… I wouldn’t know what [0, 1) means. I think it’s helpful to say a value between 0 and 1, excluding 1.
2nd attempt: 😃