I\'m trying to generate in python random floats in the range of [0.8,0.9] , but unfortanetly all the tools i found could only generate randoms in the range of [a,b) for floa
The probability of generating exactly an endpoint value should be negligible. What bad consequences do you worry about if you just use Random.uniform(0.8,0.9)
? (And are you also worried about the fact that the double-precision floats you get when you say "0.8
" and "0.9
" aren't in fact exactly 8/10 and 9/10?)
It's possible that you have very unusual requirements; but for, say, 99.9% of applications I think the answer is: just use Random.uniform(a,b)
and don't worry about it.