size of limb

Gunnar gunix at comhem.se
Sun Aug 7 10:10:38 CEST 2005


Hi.
I have a question about the size of the limb.
For example, if you use 32 bit limbs, do you then let the number stored in the 
limb be 32 bit large, or only about 16?

The thing is that when multiplying these two numbers, you get eithe a 64 bit 
result or a 32 bit result.
Now you have to decide which is most efficient:
1) handling overflow of the 64 bit number (it doesn't fit in a 32 bit number) 
or
2) using only 16 bits and then using twice as many limbs.

I'm interested to know how do you do this in GMP, and why did you decide on 
doing it that way. 
I'm sure this might differ between different kind of hardware/OS. Are there 
also any significant pros/cons regarding this problem when comparing "32bit 
machines" to "64 bit machins"?
 
Regards
Gunnar.


More information about the gmp-discuss mailing list