Closed
Description
Description
https://json.nlohmann.me/api/basic_json/operator_le/
Compares whether one JSON value lhs is less than or equal to another JSON value rhs by calculating #cpp !(rhs < lhs).
This means that <=
always has the opposite result to >
even for NaN. Which gives weird results like json(NAN) <= json(NAN)
is true but json(NAN) < json(NAN)
is false while json(NAN) == json(NAN)
is also false #514.
Reproduction steps
printf("%i %i\n", json(NAN) <= json(NAN), NAN <= NAN);
printf("%i %i\n", json(NAN) < json(NAN), NAN < NAN);
Expected vs. actual results
Actual:
1 0
0 0
Expected:
0 0
0 0
Minimal code example
No response
Error messages
No response
Compiler and operating system
clang
Library version
3.7.0
Validation
- The bug also occurs if the latest version from the
develop
branch is used. - I can successfully compile and run the unit tests.