Hacker News new | ask | show | jobs
by BeetleB 1256 days ago
I believe the reason he is pointing out this distinction is that if it is a macro, it can be optimized out causing bugs.
2 comments

Sure with -fast-math or similar compiler options without a way to also say “preserve NaNs”, that could happen with macros, but it can also happen with inline functions where the body is in a header file.
Not in a sound implementation. E.g. in macOS/iOS’s libm, we replace the isnan() macro with a function call if you compile with fast-math precisely to prevent this.