Hacker News new | ask | show | jobs
by fizzynut 661 days ago
Is it possible to get rid of all the macros TO_FIXED, FROM_FIXED, mult, etc and replace them with a class with the correct constructors / operator overloads?

Then your code doesn't ever need to be aware of the special fixed point math and horrible syntax everywhere and everything just works?

1 comments

Yes it can. I’ve seen it done properly only once though. You still have to pay attention to avoid overflows