3 ms·
Mmm, great points. At least for range [0,MAXINT], it is simple to fill the bitspace for an integer. Range [0,limit) requires slightly more-awkward division. T
by quesera 4y ago
Mmm, great points.
At least for range [0,MAXINT], it is simple to fill the bitspace for an integer. Range [0,limit) requires slightly more-awkward division.
The problem of uniformity across the range in a populated float is critical -- as you point out, IEEE float layouts are not simple.
I would guess that the "float" result is constructed as a fixed-point decimal in the same way you would an integer (sprinkle the RNG bits over the storage bitspace), but returned as float (via cast or math) to match the language type system.