In GCC, CLANG, MSVC and ICC, calling the C99 macro isnan
on a double NAN will evaluate to 1
, while in mingw it evaluates to -1
instead. Strictly speaking, I guess it's still standard-compliant, but a source of bugs and differences w.r.t pretty much every other compiler. Would be nice if it could evaluate instead to 1
.
It's not "strictly speaking." It's "standards compliant." First rule of compilers, never take results that are standard compliant and compare values. The comparison code is broken if it expects +1, as any nonzero value is valid.