test if an unsigned long fits in a limb.

Niels Möller nisse at lysator.liu.se
Wed Mar 7 09:14:30 CET 2012

Torbjorn Granlund <tg at gmplib.org> writes:

> nisse at lysator.liu.se (Niels Möller) writes:
>   One can have alternative functions accepting mp_limb_t and
>   mp_limb_signed_t, if one finds that useful.
> That would be nice, and so would functions accepting long long.
> But unfortunatly, neither is possible if we want one GMP interface per
> release, since some compilers do not support these types (but could well
> compile user code which links beautifully to GMP).

I'm not following you. Surely, on all platforms supported by GMP,
mp_limb_t is a type supported by the compiler?

As for functions taking arguments of type long long, that support would
have to depend on a configure check for long long, and exclude that
interface if long long is not present. I don't think that should be a
big deal; If a program used that feature it will fail to work on systems
without long long, but the reason for the failure is not primarily that
the functions were excluded in the GMP build, but that the program uses
a type not supported by the compiler.


Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list