convert mpz_t integer to raw file

Décio Luiz Gazzoni Filho decio at decpp.net
Sun Apr 25 17:32:10 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use gmp_printf("%Zd\n", some_mpz_t_variable); to do the same thing.

By the way, there's an entry on the top level of the manual which says: 
``Formatted Output: printf style output.'' And there 
(http://www.swox.com/gmp/manual/Formatted-Output.html) the gmp_printf() call 
is documented.

Décio

On Sunday 25 April 2004 08:06, Balaji  Sathyanarayanan wrote:
> <P>
> &nbsp; <BR>
> &nbsp; Hai everybody,<BR>
> &nbsp; &nbsp;  I need to convert integer value to its ascii format.<BR>
> &nbsp; &nbsp;  For example to represent integer 2 i'll do,<BR>
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
> printf(&quot;%c&quot;,2);<BR> &nbsp; &nbsp;  I need the equivalent function
> in gmp, or the way to do it.<BR> &nbsp; &nbsp;  I saw the mpz_out_raw(...)
> function, it ( DO THE SIMILAR THING) , BUT IT WRITES THE EXTRA 4 BYTES OF
> LENGTH INFORMATION IN THE STARTING OF THE FILE. I DON'T NEED THAT LENGTH
> INDICATOR FIELD.<BR> &nbsp; &nbsp;  - BALAJI S
> </P>
> <br><br>
> <A target="_blank"
> HREF="http://clients.rediff.com/signature/track_sig.asp"><IMG
> SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com
>/inbox.htm at Bottom" BORDER=0 VSPACE=0 HSPACE=0></a>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAi9oOFXvAfvngkOIRAkw/AJ9OEmw3BQjzlltrhcLztXUwZdhdGgCeMyCn
7+yXJvbr+UD2dWa6lW0Umg8=
=u4e6
-----END PGP SIGNATURE-----


More information about the gmp-discuss mailing list