"Fixed precision" integers

Jim White mathimagics at yahoo.co.uk
Wed Aug 29 12:56:40 CEST 2007


> From: point14 at magma.ca
> Subject: fixed size integer arithmetic
 
> Is it possible in GMP to have the size of integers
> (like mpz_t) to be fixed in size 


I think I know what you mean - you want to put a bound
on the maximum number of digits (bits, whatever). If
an integer "overflows" you just want to keep the most
significant digits.

If this is correct, then the easiest way that I have
found to do this is to simply use mpf_t's instead of
mpz_t's ... 

Cheers
Jim White
MIS, ANU, Canberra


More information about the gmp-discuss mailing list