Operators <= and >= are defined through operator< (Scalar.cpp:857), which in turn calls a compare function. If the compare function returns cmpUnordered, operator< return false, which gets negated and operators <= and >= return an incorrect value true.
Source file with 2 comparisons, to see the operator results from the compiler:
#include <limits>
int main() {
float fnan = std::numeric_limits<float>::quiet_NaN();
double dnan = std::numeric_limits<double>::quiet_NaN();
bool float_comparison = 1.0f <= fnan;
bool double_comparison = 1.0 >= dnan;
return 0;
}
LLDB log:
(lldb) expr float_comparison
(bool) $0 = false
(lldb) expr double_comparison
(bool) $1 = false
(lldb) expr 1.0f <= fnan
(bool) $2 = true
(lldb) expr 1.0 >= dnan
(bool) $3 = true
Maybe operators <= and >= should analyze result separately, like in APFloat.h:1240.