Are rand(Float32) really uniform in [0,1)?

First you need to define what a uniform distribution means in the first place. The best formal meaning I have for our current definition is:

rand(Float32) < p has probability p of being true for all p that are multiples of 2^{-24} in [0, 1]. Note that the Float32s in [0.5, 1] are the multiples of 2^{-24}. The exact inequality operator here matters, as does the precision of p. It matters how you use it!

1 Like