Hi, checking whether a floating point exception occurred is good coding practice for me.
I discovered a strange behavior using dmd. divByZero.d: import std.math; unittest { auto a = 1.0L; assert(!ieeeFlags.divByZero); a /= 0.0L; assert(ieeeFlags.divByZero); } $ rdmd --main -unittest divByZero.d passes, but $ rdmd -O --main -unittest divByZero.d makes the second assert fail. Similar behavior if I enable floating point exceptions FloatingPointControl fpctrl; fpctrl.enableExceptions(FloatingPointControl.severeExceptions); Without optimization I get a floating point exception. With optimization the code passes even though it shouldn't. In sum neither floating point exceptions nor status flags are working when optimizations are turned on. $ dmd | head -1 Digital Mars D Compiler v2.052 Jens