mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
merge
This commit is contained in:
commit
d58a0b6876
2 changed files with 5 additions and 2 deletions
|
@ -355,7 +355,10 @@ class Random(_random.Random):
|
|||
|
||||
"""
|
||||
u = self.random()
|
||||
c = 0.5 if mode is None else (mode - low) / (high - low)
|
||||
try:
|
||||
c = 0.5 if mode is None else (mode - low) / (high - low)
|
||||
except ZeroDivisionError:
|
||||
return low
|
||||
if u > c:
|
||||
u = 1.0 - u
|
||||
c = 1.0 - c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue