The practical behavior of quantumrandom.randint(min, max) is that it returns numbers in the range of min..(max - 1). This means it works like the python built-in range() function, but it deviates from the behavior of random.randint() which I assume this module's method is intended to replicate. You can see this discrepancy in action with the following code snippet:
import quantumrandom, random, time
while True:
qrand = int(quantumrandom.randint(0,1)) # forcing to int for python3
rand = random.randint(0,1)
print(qrand, rand)
time.sleep(0.1)
qrand will only ever print 0, while rand will print either 0 or 1.
Implementing this PR will probably break existing scripts that use this module, but the confusion between the random and quantumrandom versions of the method will no doubt lead to unintentional errors due to bad assumptions. If the behavior isn't changed, I think the documentation should at least mention this issue explicitly.
The practical behavior of
quantumrandom.randint(min, max)
is that it returns numbers in the range of min..(max - 1). This means it works like the python built-inrange()
function, but it deviates from the behavior ofrandom.randint()
which I assume this module's method is intended to replicate. You can see this discrepancy in action with the following code snippet:qrand
will only ever print 0, whilerand
will print either 0 or 1.Implementing this PR will probably break existing scripts that use this module, but the confusion between the
random
andquantumrandom
versions of the method will no doubt lead to unintentional errors due to bad assumptions. If the behavior isn't changed, I think the documentation should at least mention this issue explicitly.