C++ gcc关联旗标志是否会禁用float nan值?
我正在使用许多浮点数据来处理统计功能。我希望它运行更快,但ofast
禁用NAN(fno-finite-Math-Math-gly-code
flag),在我的情况下,这是不允许的。
在这种情况下,仅开启cosediative-Math
是安全的吗?我认为,即使数组包含NAN,此标志也允许向量数组的向量总和之类的东西。
I'm working with statistic functions with a lot of float data. I want it to run faster but Ofast
disable NAN (fno-finite-math-only
flag), which is not allowed in my case.
In this case, is it safe to turn on only associative-math
? I think this flag allows things like vectorized sum of vector array, even if the array contains NAN.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 docs :
因此,如果您想正确处理NAN,则不应使用
- fassociative-Math
。From the docs:
So if you want correct handling of NaNs, you should not use
-fassociative-math
.