News for hackers. Stuff that matters.
Re:High Performance Correctly Rounded Math Libraries for 32-... by ant6n on Friday August 27, 2021 @05:06PM (#28332972)
For a game boy (original) project I wanted to represent distance values in range 0.3..32 with a u8, but with higher precision for closer values, but approximately linear relationship for distances that are close to one another, with precision of ~0.05 around d=0 and <0.30 around d=32.

I ended up creating a set of values that follows different mathematical functions in different segments (exponential, linear, quadratic). As a float this wouldn´t have worked, because the precision halves for every new exponent, so the distances between adjacent values are not approximately linear.

There are no comments on this comment yet.