Use floor division operator.

This commit is contained in:
Raymond Hettinger 2004-09-27 15:29:05 +00:00
parent 4837a223ee
commit ffdb8bb99c
7 changed files with 8 additions and 8 deletions

View file

@ -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()"