From 967735760dfe4c56daf58bb54a8081695128b229 Mon Sep 17 00:00:00 2001 From: Cai-Huayi Date: Thu, 21 Nov 2024 10:49:45 +0800 Subject: [PATCH] Clarify that random.uniform() returns values in [a, b) --- Doc/library/random.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/random.rst b/Doc/library/random.rst index ef0cfb0e76cef6..8dd5d61c0def83 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -310,6 +310,10 @@ be found in any statistics text. depending on floating-point rounding in the expression ``a + (b-a) * random()``. + .. note:: + The value *b* is not included in the range due to the underlying implementation. + The random number N is drawn from a uniform distribution over the half-open interval ``[*a*, *b*\)``. + .. function:: triangular(low, high, mode)