Chud Pi and "raw" output (cino hilliard)

Jim White mathimagics at yahoo.co.uk
Sun Nov 18 01:07:01 CET 2007


>     mpf_get_str(pi_str,&expptr,10,d+2,qi);
>     mpz_set_str(piz,pi_str,10);
>     mpz_out_raw(fptr1,piz); //save compressed

Much quicker would be write yourself a pair of 
mpf_out_raw and mpf_in_raw functions. For output just
dummy up an mpz_t pointing to the mpf, write the size
and exponent, then mpz_out_raw.

The input process is similarly simple.

No radix conversion whatsoever, hence virtually nil
overheads.

Cheers

Jim




More information about the gmp-discuss mailing list