Quote:
Originally Posted by PRoSToTeM@
random(X) is returning value from 0 to X-1, if X=0 then we should get value from 0 to -1, but there are no integer numbers between 0 and -1.
|
I understand the math. I'm talking about common sense usage of the function.
Quote:
Originally Posted by PRoSToTeM@
Also, you should never use random(0)%X instead of random_num(0, X-1), because with random(0)%X you won't get uniform distribution (rand in C/C++ has the same problem). And unfortunately random(X) also has this problem.
|
Yeah, I was thinking about that too.
Regardless, to maintain backward compatibility, the only thing that can be done is to document the behavior.
__________________