-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
documentationkind: questionstate: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite option
Description
The operator==() method for json objects uses '==' on the underlying number_float_t type. This may result in false negatives and is contrary to the function's documentation which states "Floating-point numbers are compared indirectly: two floating-point numbers f1 and f2 are considered equal if neither f1 > f2 nor f2 > f1 holds". Could this behavior be changed to abs(f1 - f2) < std::numeric_limits<number_float_t>::epsilon() ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationkind: questionstate: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite option