Accuracy loss when calculating magnitudes <1 against magnitudes >1

bodrato at bodrato at
Sat May 31 14:11:53 UTC 2014


Il Sab, 31 Maggio 2014 4:16 am, Jim Bob ha scritto:
> I think I have found a bug when calculating numbers regardless of
> operation yet with magnitudes <1 against numbers with magnitudes >1.

The manual [ ]
"[...] decimal fractions like 0.1 cannot be represented exactly. [...]
This makes [float and mpf_t] highly unsuitable for calculations involving
money or other values that should be exact decimal fractions. (Suitably
scaled integers, or perhaps rationals, are better choices.)"

The "rationals" way was discussed recently on our lists:
(and previous messages.)

> Aside from this small issue, thank you so much for such a great library!

Thank you for using and testing it,


More information about the gmp-bugs mailing list