From 572688e736f22e5b23e2b3b19ba9d37770e8508c Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Wed, 14 Feb 2024 18:40:46 +0100 Subject: FloatUtil Epsilon ops: Generalize all epsilon operations by allowing passing a zero epsilon value to reduce complexity in upper math layers --- src/jogl/classes/com/jogamp/math/FloatUtil.java | 32 ++++-- .../test/junit/math/TestFloatUtil01NOUI.java | 119 +++++++++++++++++---- 2 files changed, 127 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/jogl/classes/com/jogamp/math/FloatUtil.java b/src/jogl/classes/com/jogamp/math/FloatUtil.java index e75e86b7f..94182baec 100644 --- a/src/jogl/classes/com/jogamp/math/FloatUtil.java +++ b/src/jogl/classes/com/jogamp/math/FloatUtil.java @@ -1428,7 +1428,11 @@ public final class FloatUtil { } /** - * Return true if both values are equal, i.e. their absolute delta < epsilon. + * Returns true if both values are equal, i.e. their absolute delta < {@code epsilon} if 0 != {@code epsilon}, + * otherwise == {@code 0}. + *

+ * {@code epsilon} is allowed to be {@code 0}. + *

*

* Implementation considers following corner cases: *