diff --git a/include/blt/math/math.h b/include/blt/math/math.h index df6ae91..58abd31 100644 --- a/include/blt/math/math.h +++ b/include/blt/math/math.h @@ -11,7 +11,13 @@ #include namespace blt { - + + constexpr float EPSILON = 0.0001f; + + static inline constexpr bool f_equal(float v1, float v2) { + return v1 >= v2 - EPSILON && v1 <= v2 + EPSILON; + } + /** * fast number integer */