Skip to content

Commit 9677357

Browse files
committed
Clarify that random.uniform() returns values in [a, b)
1 parent 32428cf commit 9677357

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/random.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ be found in any statistics text.
310310
depending on floating-point rounding in the expression
311311
``a + (b-a) * random()``.
312312

313+
.. note::
314+
The value *b* is not included in the range due to the underlying implementation.
315+
The random number N is drawn from a uniform distribution over the half-open interval ``[*a*, *b*\)``.
316+
313317

314318
.. function:: triangular(low, high, mode)
315319

0 commit comments

Comments
 (0)