3 ms·
Interesting, I assumed java and javascripts behaviour were common. I dont recall seeing this notation before either [0,1) maybe i will now %)
by strainer 10y ago
Interesting, I assumed java and javascripts behaviour were common. I dont recall seeing this notation before either [0,1) maybe i will now %)
- mark-r 10y agoI usually use C++ or Python, so I had to look up the others. From Java: "Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0." From Javascript: "Return a random number between 0 (inclusive) and 1 (exclusive)" So yes, all 4 are consistent in not including 1.0 in the range of random real numbers. I'd call that common. For more on the notation see https://en.wikipedia.org/wiki/Interval_(mathematics)#Including_or_excluding_endpoints https://en.wikipedia.org/wiki/Interval_(mathematics)#Includi...
- strainer 10y agoApologies I wasn't following properly, and thanks for the interval math pointer.