Mantissa string from mpf_get_str can be wrong in some least-significant digits

Torbjorn Granlund tg at
Sat Sep 12 22:43:19 CEST 2009

Uwe Mueller <um.computing at> writes:

  This bug report concerns GMP versions 4.2.1, 4.3.1 and probably also
  others. It contains a test program, error description and a suggested
  The issue is shown by the attached test program. It calculates the
  string representation of some big numbers by the function mpf_get_str
  with different values for n_digits. The respective result is compared
  with the exact (n_digits = 0) result. The differences are displayed.
  The test program does not take any arguments.
[Sorry for the slow answer]

I don't see any test program as part of your message.  Perhaps
you forgot to include it?

I think the current code, as of July 2009, should work better.  Please
see or specifically this change:


More information about the gmp-bugs mailing list