Is it really possible for rand to throw a zero?

See this discussion if you want the 1 instead:

As for the reason: various conventions exist, this is a common one. It is somewhat convenient: the actual value is generated in [1, 2), then adjusted. You may be interested in the source, eg

3 Likes