https://issues.dlang.org/show_bug.cgi?id=14452
Walter Bright <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution|--- |WONTFIX --- Comment #9 from Walter Bright <[email protected]> --- Whether the exception happens or not depends on whether the compiler uses XMM operations or X87 operations. The programming world has largely abandoned the X87, and the notion of throwing exceptions based on NaNs. I suggest abandoning such code as well, it is always going to be subject to the vagaries of code generations. We also had to give on supporting signaling NaNs for similar reasons. Another problematic issue is floating point constant folding - exceptions aren't thrown at compile time, so depending on optimization settings the runtime exception can come and go in rather arbitrary ways. And lastly, the X87 control word tends to wreak havoc with pure functions because it is a global setting. However, NaN tracking is consistent and works well. I recommend changing your code to simply test for NaN in the final result. I'm marking this as "won't fix". I have no idea how to fix it in a consistent manner, I suspect it is not possible. --
