Is GMP built into GCC?

You need GMP to create GCC from source. Does this mean that GCC has built-in arithmetic of arbitrary precision?

+1
source share
1 answer

GCC uses GMP at compile time.

I believe that one of the reasons may be that some kind of language standard (maybe Fortran90, but probably not C99) requires calculating the arithmetic of constant expressions with "infinite" precision. So, if the source code contains 1234567890*9876543210*123098456876 , which should be (at least for some Fortran dialects?), Calculated in full. For this, GCC uses GMP.

Do not think that a compiled GCC program can do bignum arithmetic (at runtime) without binding a bignum library such as Gmp.

And you can try CommonLisp, for example. SBCL . This gives you arithmetic of a signal with interactive dynamic compilation.

+3
source

All Articles