mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Bug #1590891: random.randrange don't return correct value for big number
Needs to be backported.
This commit is contained in:
parent
ebbeed781d
commit
94547f7646
3 changed files with 11 additions and 1 deletions
|
@ -205,7 +205,7 @@ class Random(_random.Random):
|
|||
raise ValueError, "empty range for randrange()"
|
||||
|
||||
if n >= maxwidth:
|
||||
return istart + self._randbelow(n)
|
||||
return istart + istep*self._randbelow(n)
|
||||
return istart + istep*int(self.random() * n)
|
||||
|
||||
def randint(self, a, b):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue