gpt4 book ai didi

c - 为什么 -freciprocal-math 在 GCC 中不安全?

转载 作者:太空狗 更新时间:2023-10-29 16:41:12 26 4
gpt4 key购买 nike

-freciprocal-math 在 GCC 中修改如下代码

double a = b / c;

 double tmp = 1/c;
double a = b * tmp;

在 GCC 手册中,据说这样的优化是不安全的,并且不符合 IEEE 标准。但我想不出一个例子。你能举个例子吗?

最佳答案

除以 10 和乘以 0.1000000000000000055511151231257827021181583404541015625 不是一回事。

关于c - 为什么 -freciprocal-math 在 GCC 中不安全?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10679154/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com