From c7694f6c8450930210268f258d92b22d7da4c735 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 4 Mar 2020 21:01:11 -0500 Subject: [PATCH] Math: Correct epsilon values for close_enough() These two overloads should be using DBL_EPSILON. --- include/zeus/Math.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zeus/Math.hpp b/include/zeus/Math.hpp index 32b4d87..3d9b821 100644 --- a/include/zeus/Math.hpp +++ b/include/zeus/Math.hpp @@ -163,11 +163,11 @@ template [[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; } -[[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; } } // namespace zeus