]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-101097: Switch from standard interval notation to greater or less than signs for...
authorAndrew Hong <andrewhong@myyahoo.com>
Sun, 22 Jan 2023 20:58:36 +0000 (15:58 -0500)
committerGitHub <noreply@github.com>
Sun, 22 Jan 2023 20:58:36 +0000 (14:58 -0600)
Doc/library/random.rst
Lib/random.py

index d944518a7909bc895f4f056a375ff31112cb7b92..4522f5a8d26b9d7c5fa2a2279004ee80285953fc 100644 (file)
@@ -21,8 +21,8 @@ lognormal, negative exponential, gamma, and beta distributions. For generating
 distributions of angles, the von Mises distribution is available.
 
 Almost all module functions depend on the basic function :func:`.random`, which
-generates a random float uniformly in the semi-open range [0.0, 1.0).  Python
-uses the Mersenne Twister as the core generator.  It produces 53-bit precision
+generates a random float uniformly in the half-open range ``0.0 <= X < 1.0``.
+Python uses the Mersenne Twister as the core generator.  It produces 53-bit precision
 floats and has a period of 2\*\*19937-1.  The underlying implementation in C is
 both fast and threadsafe.  The Mersenne Twister is one of the most extensively
 tested random number generators in existence.  However, being completely
@@ -294,7 +294,7 @@ be found in any statistics text.
 
 .. function:: random()
 
-   Return the next random floating point number in the range [0.0, 1.0).
+   Return the next random floating point number in the range ``0.0 <= X < 1.0``
 
 
 .. function:: uniform(a, b)
index 1c9e1a48b6626b808b55f9a4d7e08043396c9641..3c4291f6a652a0b6f7e22f9e87e093e7fa161f2f 100644 (file)
@@ -849,7 +849,7 @@ class SystemRandom(Random):
     """
 
     def random(self):
-        """Get the next random number in the range [0.0, 1.0)."""
+        """Get the next random number in the range 0.0 <= X < 1.0."""
         return (int.from_bytes(_urandom(7)) >> 3) * RECIP_BPF
 
     def getrandbits(self, k):