3 ms·
> 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.
by tuatoru 5y ago
> 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.
- SuchAnonMuchWow 5y agoYou 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.
- benhoyt 5y agoSarcasm 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.
- tuatoru 5y agoThank 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.