jeudi 13 septembre 2018

Random float - uniform w.r.t. continuous number line

How to generate floats which are uniform w.r.t. the continuous number line? (i.e., a number between 1.0 and 2.0 is equally likely as a number between 100000 and 100001).

I only know how to generate random floats uniform w.r.t. the distinct bit patterns (i.e., each bit pattern is equally likely).

The algorithm should be uniform along the whole range of the representable number range.




Aucun commentaire:

Enregistrer un commentaire