Hacker News new | ask | show | jobs
by binarycoffee 1406 days ago
This is a widely used method to map random integers to floating point numbers, but it has the disadvantage of wasting 1 bit of float mantissa precision.

On modern CPUs, its computational advantage over full-precision mapping methods, such as multiplication by a float, is not always clear [1].

[1] https://github.com/rust-random/rand/issues/416