mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Issue 6261: Clarify behavior of random.uniform().
This commit is contained in:
parent
59e6eb1c3b
commit
be40db07c6
2 changed files with 3 additions and 1 deletions
|
@ -333,7 +333,7 @@ class Random(_random.Random):
|
|||
## -------------------- 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 --------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue