Incorrect results from gmp-chudnovsky.c

tg at tg at
Tue Mar 17 12:53:04 UTC 2015

michael <michael.rychlik at> writes:

  I just compiled gmp-chudnovsky.c from the source file here:
  I find that when asked to produce 50,000,000 digits of PI the least significant 
  digit produced is wrong.
  $ ./gmp-chudnovsky 50000000 1 > pi_50000000.txt
  The output is:
  The expected output is:
Depends on your definition, I suppose.  The value printed is correctly

In your opinion, should 5 digits of pi be 3.1415 or 3.1416?  And how
would you write 1 digit of 2-10^(-100) = 1.99999...?  Would that be "1"
to you?

  Additionally it is outputing the wrong number of digits. That last "46" are 
  actually the 50000001 and 50000002 digits of PI.
The two extra digits are for free.

Please encrypt, key id 0xC8601622

More information about the gmp-bugs mailing list