| 84 | : epsilon(static_cast<T>(options.atol())) {} |
| 85 | |
| 86 | bool operator()(T x, T y) const { |
| 87 | if (x == y) { |
| 88 | return Flags::signed_zeros_equal || (std::signbit(x) == std::signbit(y)); |
| 89 | } |
| 90 | if (Flags::nans_equal && std::isnan(x) && std::isnan(y)) { |
| 91 | return true; |
| 92 | } |
| 93 | if (Flags::approximate && (fabs(x - y) <= epsilon)) { |
| 94 | return true; |
| 95 | } |
| 96 | return false; |
| 97 | } |
| 98 | |
| 99 | const T epsilon; |
| 100 | }; |