GMP是否内置于GCC? [英] Is GMP built into GCC?

查看:166
本文介绍了GMP是否内置于GCC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您需要GMP从源代码构建GCC。这是否意味着GCC具有内置的任意精度算法?

解决方案

GCC在编译时使用GMP <我认为其中一个原因可能是某些语言标准(可能是Fortran90,但可能不是C99)要求计算常量表达式的算术运算无限的精度。因此,如果一个源代码包含 1234567890 * 9876543210 * 123098456876 应该是(至少对于Fortran的某些方言?)完全计算。对于那个GCC使用GMP。



不要以为GCC编译的程序可以做 bignum 算术(在运行时),不需要链接像Gmp这样的数据库。

你可以尝试CommonLisp,例如。它为您提供交互式动态编译的数字算术。

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

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.

这篇关于GMP是否内置于GCC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆