Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix integer generator to generate uniform numbers #46
?RANDOM:uniform(0, Number) is sufficient for random number generation.
This fixes random number generation case:
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
First of all, apologies for the delay in reacting on this one.
We are not going to merge this pull request. The generation of random integers in PropEr cannot be totally random. It needs to be skewed so that it generates "several small numbers, including 0", "the same number more than once", "some numbers that are likely to be boundaries, e.g. close to byte()-end", etc.
However, you raise a valid point in your mail(*) reporting that the range you get is perhaps not the one you would have expected. We should look into this issue, but its solution is not the one this pull request proposes. (Actually, you should have expected that because if it were so simple we would not have spent the extra effort to write the generator that currently exists in PropEr's code base.)
(*) The pointer to your original mail in your pull request is the wrong one, at least now that I write this...