id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,testcase,blockedby,blocking,related,differential,wikipage
1656,Bignum exponentiation yields wrong results,rvb@…,,"I've used the following GHC program:
main = print $ 9^9^9
The result was right in the number of digits (approx. 350 millions) but the last to digits are 94. By quick modular exponentiation, one finds out that 9^9^9 mod 100 = 89. So the number is obviously wrong. Looking further, at least the last 100 digits are wrong.
I have redone the calculation with demo/calc/calc.c included in the distribution of the GNU gmp library. This yields a different number, that could be correct ( 89, but I don't know if it is otherwise correct)
In both cases, the same libgmp3 shared object was used. But the GHC version constantly used 8 GiB of memory and four hours just for outputting the value in base 10, while the calculation of the value had been finished in about 5 minutes. demo/calc/calc.c used about 30 minutes for the whole job.",bug,closed,normal,6.8.1,Compiler,6.6,worksforme,,,Linux,x86_64 (amd64),,,,,,,