oz1cz
oz1cz

Reputation: 5834

Is GMP built into GCC?

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

Upvotes: 2

Views: 364

Answers (1)

GCC uses GMP at compile-time.

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

Don't think that a GCC compiled program can do bignum arithmetic (at run time) without linking a bignum library like Gmp.

And you could try CommonLisp, e.g. SBCL. It gives you bignum arithmetic with interactive dynamic compilation.

Upvotes: 4

Related Questions