Hacker News new | ask | show | jobs
by dahart 40 days ago
That code is absolutely terrible! Never do that. The range is awful, and the relative error is awful.

If you want a double in 32 bits, convert to single precision float. This will beat the relative error of the code you linked to by orders of magnitude, and allow the range of float (~1e38) rather than be limited to +- 1e9.