summary refs log tree commit diff
path: root/src/Math/Functions.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Math/Functions.hpp')
-rw-r--r--src/Math/Functions.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Math/Functions.hpp b/src/Math/Functions.hpp
index fd99c6d..0cda6bd 100644
--- a/src/Math/Functions.hpp
+++ b/src/Math/Functions.hpp
@@ -38,9 +38,16 @@ R sign(T x) {
 
 // III. Utility functions.
 
+// Compares two floating point numbers for equality, with a given epsilon.
 template <typename T>
 Bool floats_equal(T a, T b, Real epsilon = 0.0001f) {
     return std::abs(a - b) < epsilon;
 }
 
+// Compares two floating point numbers for inequality, with a given epsilon.
+template <typename T>
+Bool floats_less(T a, T b, Real epsilon = 0.0001f) {
+    return a < b - epsilon;
+}
+
 }
\ No newline at end of file