64-bit integer conversion support

Arseny Kapoulkine arseny.kapoulkine at gmail.com
Thu Apr 26 13:19:38 CEST 2007


Hello,

I am developing a bigint library, which will have GMP as one of it's
implementation. I'd like to provide functions for converting between 64-bit
integer (both signed and unsigned) and bigint. The problem is that GMP's
integer conversion functions do not seem to support 64-bit integers (that
is, when long type is not 64-bit).

I can do something similar to what mpz_get_si does, only use more limbs if
needed, but this approach depends on GMP internal representation, which I
don't quite like.
Also there are import/export functions, but as I understand they are for
different purpose - it's just binary serialization, not conversion to
natively supported type.

So, the question is - what are the available options if I want to achieve
maximum portability, and performance is not critical here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20070426/378eb9db/attachment.html 


More information about the gmp-discuss mailing list