News for hackers. Stuff that matters.
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by quesera on Saturday January 28, 2023 @12:01PM (#34559212)
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.

There are no comments on this comment yet.