summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2006-12-20 06:42:06 (GMT)
committerRaymond Hettinger <python@rcn.com>2006-12-20 06:42:06 (GMT)
commit94547f7646895e032f8fc145529d9efc3a70760d (patch)
treeb3bd1dec4781ba00953d8e57b6d8e84fa3d06e91 /Lib/random.py
parentebbeed781d923494f782f0750e76ad4aac8e29f5 (diff)
downloadcpython-94547f7646895e032f8fc145529d9efc3a70760d.zip
cpython-94547f7646895e032f8fc145529d9efc3a70760d.tar.gz
cpython-94547f7646895e032f8fc145529d9efc3a70760d.tar.bz2
Bug #1590891: random.randrange don't return correct value for big number
Needs to be backported.
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py
index ae2d434..b80f1a1 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -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):