vendredi 7 août 2015

Why is the upper bound exclusive in most RNGs?

Most programming languages provide (pseudo) random number generators and many of them have handy methods to generate integer numbers in a certain range. In all implementations I've seen so far, the lower bound of the range is inclusive while the upper bound is exclusive.

Is there a specific technical or historical reason for this?

I can imagine that it is just convenient when working with indices or lengths but I couldn't find any valuable evidence for that.




Aucun commentaire:

Enregistrer un commentaire