fixed size integer arithmetic

Paul Zimmermann Paul.Zimmermann at loria.fr
Wed Aug 29 11:46:03 CEST 2007


> Date: Tue, 28 Aug 2007 23:22:52 -0400 (EDT)
> From: point14 at magma.ca
> 
> Hello,
> 
> Is it possible in GMP to have the size of integers (like mpz_t) to be 
> fixed in size and invariant (eg, a fixed number of bits) as well as being 
> arbitrarily large?
> 
> I mean once it's declared or initialized to be of a certain size, the size 
> no longer changes, and arithmetic operations (add, mul, etc) that would 
> normaly grow the number would simply cause it to roll over.
> 
> Is this possible with GMP and if not, do you have suggestions?
> 
> Thanks,
> Martin

Please could you be more specific? What do you expect if the size is fixed to
one bit, and you compute 1+1?

Paul Zimmermann


More information about the gmp-discuss mailing list