1. Armin Rigo
  2. cpython-withatomic

Commits

Raymond Hettinger  committed 037f3ce

Bug #1590891: random.randrange don't return correct value for big number

  • Participants
  • Parent commits b3332ec
  • Branches 2.4

Comments (0)

Files changed (2)

File Lib/random.py

View file
  • Ignore whitespace
             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):

File Misc/NEWS

View file
  • Ignore whitespace
 Core and builtins
 -----------------
 
+- Bug #1590891: random.randrange don't return correct value for big number
+
 - Bug #1542016: make sys.callstats() match its docstring and return an
   11-tuple (only relevant when Python is compiled with -DCALL_PROFILE).