3 ms·
The basic representation is usually good enough at 2 decimals (so a plain int), but it is often needed to have a transient representation during calculations.
by hrktb 7y ago
The basic representation is usually good enough at 2 decimals (so a plain int), but it is often needed to have a transient representation during calculations.
For instance if one needs to apply discounts, add taxes, split in equal parts, all of the above one after the other, there will be a more precise intermediary representation before rounding everything in a way that keeps the total amount consistent with the original amount.