News for hackers. Stuff that matters.
Re:Perfect Random Floating-Point Numbers by FabHK on Wednesday May 07, 2025 @02:35PM (#43919167)
> certain values will be far more likely than other values

That's fine, as for the normal understanding of uniformity on the interval, you want the probability that a value is chosen to be proportional to the "space" between its left and right neighbor, and that space is not constant on the interval.

What you try to emulate is picking a real number uniformly between 0 and 1, then returning the closest floating point number (except 1, maybe).

There are no comments on this comment yet.