Is GMP built into GCC?

依然范特西╮ 提交于 2019-12-11 04:36:59

问题


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


回答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.



来源:https://stackoverflow.com/questions/14263138/is-gmp-built-into-gcc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!