On Wed, Jun 5, 2024 at 4:08 PM Robert Elz <k...@munnari.oz.au> wrote: > > That's a perfect case for scaled integers - no-one ever deals with > fractions of cents in this kind of thing (a bank won't ever tell you > that your balance is $5678.17426 for example, even if the interest > calculations computed accurately might arrive at that number.)
Additionally, floating-point arithmetic introduces rounding errors that are *very undesirable* in a financial context. There, you will likely see fixed-point arithmetic, which is effectively the same thing as scaled integers.