Is there a way to extract certain portions of digits from GMP or MPFR numbers?

Michael comtech.usa at
Thu Jan 4 05:38:41 CET 2007

Hi all,

Suppose my program needs to deal with huge numbers with thousands of
precision digits. However, the focus is on the last 10s of digits of these
huge numbers. That's to say, the final results is between 0 and 1,  which is
obtained form a series of calculations of huge numbers, and then add and
subtract, so only the last a few digits remain, but the intermediate numbers
can be as large as gamma(1000).

Is there a way that I can extract the last N digits from large GMP or MPFR
numbers? Let's say N=10?

Thanks a lot,
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the gmp-discuss mailing list