c - 为什么不支持 __float128?
问题描述
因此,我尝试使用__float128
-type 在 C 中进行非常精确的数学运算。
我的代码看起来像这样:
#include <stdio.h>
int main() {
__float128 num;
}
我尝试在没有任何选项的情况下编译它:
gcc -o test test.c
我得到的错误是:
test.c:4:5: error: __float128 is not supported on this target
我的 gcc 是在 x86 Macbook 上使用 Homebrew 安装的。
解决方案
我的 gcc 是在 x86 Macbook 上使用 Homebrew 安装的。
你可能已经这样做了,但是gcc
你运行来编译你的测试程序实际上是伪装成 GCC 的 Apple clang,如果你这样做,你会看到gcc -v
。Apple clang 不支持 __float128,但真正的 GCC 支持。使用您/usr/local/bin/gcc-11 -o test test.c
安装的真正的GCC,然后它应该可以成功编译。
推荐阅读
- c# - EF Core 定义“复杂”关系
- excel - 如何在包含字母的每个第二个单元格上使用 =COUNTIF()?
- laravel - 在指定时间后更改数据库中的数据
- c# - 如何将包含字符串的 Yaml 对象反序列化为列表
? - c# - 如何使用 C# 在 NPrinting Designer 的像素报告中更改单元格/组的背景颜色
- amazon-web-services - 如何在 Spring Boot 2 中为 CloudWatch 的 Micrometer 提供凭证
- appium - 如何在机器人框架脚本中使用 adb?
- node.js - 像 Charles 这样的 HTTPS 代理
- .net - linux 上 dotnet 的 Oracle 连接问题
- scala - 如何在高阶函数中将 @unchecked 用于选项