mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Use floor division operator.
This commit is contained in:
parent
4837a223ee
commit
ffdb8bb99c
7 changed files with 8 additions and 8 deletions
|
@ -197,9 +197,9 @@ class Random(_random.Random):
|
|||
if istep != step:
|
||||
raise ValueError, "non-integer step for randrange()"
|
||||
if istep > 0:
|
||||
n = (width + istep - 1) / istep
|
||||
n = (width + istep - 1) // istep
|
||||
elif istep < 0:
|
||||
n = (width + istep + 1) / istep
|
||||
n = (width + istep + 1) // istep
|
||||
else:
|
||||
raise ValueError, "zero step for randrange()"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue