| 70 | // The same considerations as in AlmostEqualAbs apply. |
| 71 | template <typename Float> |
| 72 | bool AlmostEqualRel(Float x, Float y, Float eps) |
| 73 | { |
| 74 | return fabs(x - y) < eps * std::max(fabs(x), fabs(y)); |
| 75 | } |
| 76 | |
| 77 | // Returns true if x and y are equal up to the absolute or relative difference eps. |
| 78 | template <typename Float> |
no outgoing calls