If you want to exclude both 0 and 10, you can use prevfloat(10.0)*(1-rand())
instead.
Same argument you gave applies, the answer being uniform from (0, prevfloat(10.0)]
, i.e. (0,10)
.
If you don’t, the probability of getting a 10 on any given draw is 1/2^52 = 2.220446049250313e-16
.