Random Integer Distribution

Something I’ve noticed for a while is that the numbers that come out of the random component tend to avoid the limits of the domain. I’m curious as to the reason for this and what methods people use to get a more even number distribution.

It’s a mistake in the random component, but changing it now would cause different distributions for all existing files using these components, so I’d rather not. The problem is that it will round the integers from the floating point numbers, so every integer N within the range gets all the values from N-0.5 to N+0.5, except for the first and last ones which only go from 0.0 to 0.5 and from M-0.5 to M respectively.

One thing you can do is grow the range by (nearly) half a unit on either end. If you grow by a full half unit, you may get rounding errors.

That makes sense. Thanks!