Incorrect results from gmp-chudnovsky.c

michael michael.rychlik at
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:

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:


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