Hi mpf_trunc is driving me mad...

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


       Carlos,

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
5261856276.

Hope this helps,
Paul Zimmermann


More information about the gmp-bugs mailing list