Accuracy loss when calculating magnitudes <1 against magnitudes >1

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Sat May 31 14:11:53 UTC 2014


Ciao,

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 [ https://gmplib.org/manual/Floating_002dpoint-Functions.html ]
reads:
"[...] 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:
https://gmplib.org/list-archives/gmp-discuss/2014-April/005560.html
(and previous messages.)

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

Thank you for using and testing it,
m

-- 
http://bodrato.it/papers/



More information about the gmp-bugs mailing list