Hi mpf_trunc is driving me mad...

Zimmermann Paul Paul.Zimmermann at loria.fr
Fri Nov 25 15:48:02 CET 2011


a number like 52618562.77 cannot be represented exactly in binary (because 1/10
is not representable exactly in binary) thus it is rounded, and in this case
it is rounded to a binary fraction near from 52618562.769999999999999...
This explains that when you truncate after multiplying by 100, you get

Hope this helps,
Paul Zimmermann

More information about the gmp-bugs mailing list