Math: Correct epsilon values for close_enough()

These two overloads should be using DBL_EPSILON.
This commit is contained in:
Lioncash 2020-03-04 21:01:11 -05:00
parent 6ac3066a6f
commit c7694f6c84
1 changed files with 2 additions and 2 deletions

View File

@ -163,11 +163,11 @@ template <typename E>
[[nodiscard]] bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = FLT_EPSILON); [[nodiscard]] bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = FLT_EPSILON);
[[nodiscard]] inline bool close_enough(float a, float b, double epsilon = FLT_EPSILON) { [[nodiscard]] inline bool close_enough(float a, float b, double epsilon = DBL_EPSILON) {
return std::fabs(a - b) < epsilon; return std::fabs(a - b) < epsilon;
} }
[[nodiscard]] inline bool close_enough(double a, double b, double epsilon = FLT_EPSILON) { [[nodiscard]] inline bool close_enough(double a, double b, double epsilon = DBL_EPSILON) {
return std::fabs(a - b) < epsilon; return std::fabs(a - b) < epsilon;
} }
} // namespace zeus } // namespace zeus