We can easily get random floating point numbers within a desired range [X,Y)
(note that X is inclusive and Y is exclusive) with the function listed below since
Think of it this way. If you imagine that floating-point numbers have arbitrary precision, the chances of getting exactly min
are zero. So are the chances of getting max
. I'll let you draw your own conclusion on that.
This 'problem' is equivalent to getting a random point on the real line between 0 and 1. There is no 'inclusive' and 'exclusive'.