Anonymous committed 0e1b3c2

Issue 6261: Clarify behavior of random.uniform().

Comments (0)

Files changed (2)


    Return a random floating point number *N* such that ``a <= N <= b`` for
    ``a <= b`` and ``b <= N <= a`` for ``b < a``.
+   The end-point value ``b`` may or may not be included in the range
+   depending on floating-point rounding in the equation ``a + (b-a) * random()``.
 .. function:: triangular(low, high, mode)
 ## -------------------- uniform distribution -------------------
     def uniform(self, a, b):
-        """Get a random number in the range [a, b)."""
+        "Get a random number in the range [a, b) or [a, b] depending on rounding."
         return a + (b-a) * self.random()
 ## -------------------- triangular --------------------