As far as I understand, RandomReal[]
is able to generate random numbers between 0.0 and 1.0 so thinking in Terms of an interval this means [0.0,1.0]. Now I want to exclude explicitly the value 1.0, meaning to have a half-open interval like: [0.0,1.0).
Is their an easy way to do that?
RandomReal[{0,1-$MachineEpsilon}]
? $\endgroup$myRand[] := With[{rnd=RandomReal[]}, If[rnd==1.,myRand[],rnd]]
$\endgroup$