| 714 | |
| 715 | template <typename T> |
| 716 | bool IsClose(const T& x, const T& y, double atol, double rtol) { |
| 717 | if (std::isnan(x) && std::isnan(y)) return true; |
| 718 | if (x == y) return true; // Allow inf == inf. |
| 719 | return Abs(x - y) < atol + rtol * Abs(x); |
| 720 | } |
| 721 | |
| 722 | template <> |
| 723 | bool IsClose<complex64>(const complex64& x, const complex64& y, double atol, |
no test coverage detected