Reg: gcc option for printing large number (large double)
Xinyun Zhou
me@xyzhou.com
Fri Sep 13 07:21:00 GMT 2013
On Thu, 2013-09-12 at 21:36 -0700, emailstorbala wrote:
> Hi,
> I know that in gcc, there is an option for getting this done. Can any body
> help me with that option?
>
> Thanks and Regards,
> Balamurugan R
>
>
I would suggest you have a look at the Gnu MP library, which deals with
big integers, floats and gives you lots of things that you can normally
find in languages like Python, Go or Java.
An example would be:
mpz_t a;
mpz_init(a);
mpz_set_str(a, "10000000000000000000000000000", 10);
gmp_printf("%Zd", a);
mpz_clear(a);
which will print this number back to you, and %Zx will print the Hex
version of it.
--
Xinyun Zhou
More information about the Gcc-help
mailing list