logoalt Hacker News

Sesse__yesterday at 7:54 PM0 repliesview on HN

You should multiply by 255.0, optionally add a dither (triangular is okay), and then let the FPU round using its default IEEE 754 round-to-nearest-ties-to-nearest-even mode. None of this crazy 0.5 stuff. :-)