News for hackers. Stuff that matters.
Re:Fixed Point Arithmetic by tuatoru on Monday October 18, 2021 @01:44AM (#28902591)
> I know fixed point was very important back in the day

So you don't care if your bank account is out by a percent or two?

Well, others do.

Re:Fixed Point Arithmetic by SuchAnonMuchWow on Monday October 18, 2021 @02:12AM (#28902729)
You will have the exact same issue with the fixed-point presented in the article than with floating-point: they shouldn't be used for financial transactions because they are in base 2 so they can not accurately represent decimal fractions.

There are cases where fixed-point is preferred over floating-point, such as implementing an iDFT (or in general in algorithms when the dynamic of the numbers you manipulate is fixed and you need very precise control over the rounding errors).

But the article state: "Problem: I want to do arithmetic with fractional resolution but I can't afford the CPU cycles to use floating point." which isn't true for modern hardware. The rest of the article is still very interesting, but this is just a bad start.

Re:Fixed Point Arithmetic by benhoyt on Monday October 18, 2021 @02:39AM (#28902834)
Sarcasm does not become you. :-) I'm well aware of decimal types, which is what I'd use for currency values. That or "fixed point" integer cents.
Re:Fixed Point Arithmetic by tuatoru on Monday October 18, 2021 @03:32PM (#28910420)
Thank you for taking the time to comment, rather than simply down-voting. You are right. I should not comment at the end of a day.