Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions quantumrandom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def randint(min=0, max=10, generator=None):
source_size = int(math.ceil(source_bits / float(INT_BITS)))
source_max = 2 ** (source_size * INT_BITS) - 1

modulos = source_max / rand_range
modulos = source_max // rand_range
too_big = modulos * rand_range
while True:
num = 0
Expand All @@ -123,7 +123,7 @@ def randint(min=0, max=10, generator=None):
if num >= too_big:
continue
else:
return num / modulos + min
return num // modulos + min


def uint16(array_length=100):
Expand Down