Incorrect results from gmp-chudnovsky.c

michael michael.rychlik at rsm.ie
Tue Mar 17 11:20:29 UTC 2015


This is a bug in gmp-chudnovsky.c not libgmp but I don't know where else to 
post it.

I just compiled gmp-chudnovsky.c from the source file here:
https://gmplib.org/download/misc/gmp-chudnovsky.c

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:

pi(0,7051366)=
0.314159......9456526546e1

The expected output is:

pi(0,7051366)=
0.314159......9456526545e1

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

 





More information about the gmp-bugs mailing list