<div>Hello,</div>
<div> </div>
<div>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).
</div>
<div> </div>
<div>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.</div>
<div>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.</div>
<div> </div>
<div>So, the question is - what are the available options if I want to achieve maximum portability, and performance is not critical here?</div>