You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
autosNaN = std::numeric_limits<float>::signaling_NaN();
auto r0 = sNaN + 0;
bool r1 = sNaN == 0;
bool r2 = sNaN != sNaN;
auto r3 = sNaN * 1;
auto r4 = sNaN / 1;
int n = sNaN ;
unsignedint un = sNaN ;
I only list parts of operators that are unclear to NaN, in every subclause that corresponds to the operator or conversion used the above, we do not have a wording that can define what the result is. The only possible relevant wording is in [expr.pre] p4
If during the evaluation of an expression, the result is not mathematically defined or not in the range of representable values for its type, the behavior is undefined.
It is unclear whether NaN is mathematically defined. If it were not, it would mean that even the following example also is UB
autosNaN = std::numeric_limits<float>::signaling_NaN();
int c = (sNaN , 10);