3 ms·
I 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 tha
by mark-r 10y ago
I 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.