3 ms·
No, it’s easy to assume (even after reading the documentation) that -ffast-math just makes some calculations less precise or otherwise not strictly IEEE 754 com
by Sharlin 5y ago
No, it’s easy to assume (even after reading the documentation) that -ffast-math just makes some calculations less precise or otherwise not strictly IEEE 754 compliant. That would be plenty reason enough not to enable it by default, but make it available for those who desire maximum performance at the expense of precision (or accuracy), as may be a perfectly reasonable tradeoff in cases like computer graphics. It’s very understandable that people are surprised by the fact that -ffast-math can actually break code in unintuitive ways.
- usefulcat 5y agoI was definitely not expecting it to completely break std::isnan and std::isinf.
- gumby 5y agoThe documentation literally says that the results may be incorrect, not to mention documenting that it enables a flag with unsafe in its name. I feel like a lot of programmers just type stuff and assume if it compiles it should ship.