unsigned long long conversion
jhillenbach at yahoo.com
Thu Apr 7 17:30:51 CEST 2005
Hi Keith, I converted mpz_class into unsigned long long and vice versa
unsigned long long mpz2ull (mpz_class n)
str << n;
unsigned long long ull;
str >> ull;
mpz_class ull2mpz (unsigned long long ull)
str << ull;
return mpz_class (str.str());
If u nedd mpz_t for better performance than mpz_class u can
convert mpz_t into mpz_class (resp the other way) after that.
--- keith.briggs at bt.com wrote:
> I need to assign mpz_t and mpq_t variables from unsigned long longs.
> Mpfr has functions (names with _uj) for doing this, but it seems that
> gmp does not.
> Should I use mpz_import for this, or is there a better way?
> gmp-discuss mailing list
> gmp-discuss at swox.com
Show us what our next emoticon should look like. Join the fun.
More information about the gmp-discuss