Is std::greater and std::less safe to use?
When comparing double values in C++, using the <,>,=,!= operators, we
cannot always be sure about correctness of the result. Thats why we use
other techniques to compare doubles, for example, we can compare two
doubles a and b by testing if their difference is really close to zero. My
question is, does the C++ standard library implements std::less<double>
and std::greater<double> using these techniques, or it just uses the
unsafe comparison operators?
No comments:
Post a Comment