Division by zero and Illegal Behavior

Okay, thanks, that is very helpful.

The “Undefined Behavior” isn’t explicitly mentioned, but at least it says:

Note: The program may behave in strange ways (such as not evaluating either the true or false part of an if-statement) if calculations produce Inf, NaN, or -0.0 when these flags are used.

So I assume that “behaving in strange ways” effectively means Undefined Behavior.

I guess the possibility of IB/UB should be made a bit more clear in the documentation of @setFloatMode. Maybe it is implicitly there as it says, “This is equivalent to -ffast-math in GCC.”, but considering the impact of Undefined Behavior, it might be worth being noted more explicitly.

To be honest, I wasn’t actually aware of how dangerous -ffast-math can be. But now I am.