10000 [3.11] GH-101097: Switch from standard interval notation to greater o… · python/cpython@69d12d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 69d12d8

Browse files
[3.11] GH-101097: Switch from standard interval notation to greater or less than signs for random.random()'s documentation (GH-101119) (GH-101246)
(cherry picked from commit 8bcd4a6) Co-authored-by: Andrew Hong <andrewhong@myyahoo.com> Automerge-Triggered-By: GH:rhettinger
1 parent 8cf8a68 commit 69d12d8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Doc/library/random.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ lognormal, negative exponential, gamma, and beta distributions. For generating
2121
distributions of angles, the von Mises distribution is available.
2222

2323
Almost all module functions depend on the basic function :func:`.random`, which
24-
generates a random float uniformly in the semi-open range [0.0, 1.0). Python
25-
uses the Mersenne Twister as the core generator. It produces 53-bit precision
24+
generates a random float uniformly in the half-open range ``0.0 <= X < 1.0``.
25+
Python uses the Mersenne Twister as the core generator. It produces 53-bit precision
2626
floats and has a period of 2\*\*19937-1. The underlying implementation in C is
2727
both fast and threadsafe. The Mersenne Twister is one of the most extensively
2828
tested random number generators in existence. However, being completely
@@ -273,7 +273,7 @@ be found in any statistics text.
273273

274274
.. function:: random()
275275

276-
Return the next random floating point number in the range [0.0, 1.0).
276+
Return the next random floating point number in the range ``0.0 <= X < 1.0``
277277

278278

279279
.. function:: uniform(a, b)

Lib/random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ class SystemRandom(Random):
794794
"""
795795

796796
def random(self):
797-
"""Get the next random number in the range [0.0, 1.0)."""
797+
"""Get the next random number in the range 0.0 <= X < 1.0."""
798798
return (int.from_bytes(_urandom(7)) >> 3) * RECIP_BPF
799799

800800
def getrandbits(self, k):

0 commit comments

Comments
 (0)
0