Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It has to do with how cpus do floating point division.

Here is an article that discusses this, along with workarounds:

https://dl.acm.org/doi/10.1145/3503512

From the abstract: "Drawing a floating-point number uniformly at random from an interval [a, b) is usually performed by a location-scale transformation of some floating-point number drawn uniformly from [0, 1). Due to the weak properties of floating-point arithmetic, such a transformation cannot ensure respect of the bounds, uniformity or spatial equidistributivity."



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: