From d2d9e0e8d5fb651735012bc395103b9283039929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brian=20=C3=93=20Donnell?= Date: Wed, 3 Jul 2019 10:45:15 -0400 Subject: [PATCH] Use floor division for python3 compatibility --- quantumrandom/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantumrandom/__init__.py b/quantumrandom/__init__.py index 7c4bc86..fba327b 100644 --- a/quantumrandom/__init__.py +++ b/quantumrandom/__init__.py @@ -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 @@ -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):