This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Reg: gcc option for printing large number (large double)
- From: Xinyun Zhou <me at xyzhou dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 13 Sep 2013 17:21:06 +1000
- Subject: Re: Reg: gcc option for printing large number (large double)
- Authentication-results: sourceware.org; auth=none
- References: <1379046979926-968019 dot post at n5 dot nabble dot com>
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