diff options
author | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2019-04-14 17:45:16 -0400 |
---|---|---|
committer | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2019-04-14 17:45:16 -0400 |
commit | 2ce65fa76908d77a5e3b045a8eb40c798939b8be (patch) | |
tree | 231fcb8f72a467a77efc1e6050de12bd70f7b152 /src/org/unitConverter/math/DecimalComparison.java | |
parent | d7a587694d857fa468c7aae6a5f4fda24f3577fa (diff) | |
parent | b43c399c21bddd3cb8af42c109940564c3890cf7 (diff) |
Merge branch 'release-0.2.0' into develop
Diffstat (limited to 'src/org/unitConverter/math/DecimalComparison.java')
-rw-r--r-- | src/org/unitConverter/math/DecimalComparison.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/org/unitConverter/math/DecimalComparison.java b/src/org/unitConverter/math/DecimalComparison.java index e6fb733..7cdbe5b 100644 --- a/src/org/unitConverter/math/DecimalComparison.java +++ b/src/org/unitConverter/math/DecimalComparison.java @@ -21,6 +21,7 @@ package org.unitConverter.math; * * @author Adrien Hopkins * @since 2019-03-18 + * @since v0.2.0 */ public final class DecimalComparison { /** @@ -28,6 +29,7 @@ public final class DecimalComparison { * they are considered equal. * * @since 2019-03-18 + * @since v0.2.0 */ public static final double DOUBLE_EPSILON = 1.0e-15; @@ -36,6 +38,7 @@ public final class DecimalComparison { * they are considered equal. * * @since 2019-03-18 + * @since v0.2.0 */ public static final float FLOAT_EPSILON = 1.0e-6f; @@ -48,6 +51,7 @@ public final class DecimalComparison { * second value to test * @return whether they are equal * @since 2019-03-18 + * @since v0.2.0 */ public static final boolean equals(final double a, final double b) { return DecimalComparison.equals(a, b, DOUBLE_EPSILON); @@ -64,6 +68,7 @@ public final class DecimalComparison { * allowed difference * @return whether they are equal * @since 2019-03-18 + * @since v0.2.0 */ public static final boolean equals(final double a, final double b, final double epsilon) { return Math.abs(a - b) <= epsilon * Math.max(Math.abs(a), Math.abs(b)); @@ -78,6 +83,7 @@ public final class DecimalComparison { * second value to test * @return whether they are equal * @since 2019-03-18 + * @since v0.2.0 */ public static final boolean equals(final float a, final float b) { return DecimalComparison.equals(a, b, FLOAT_EPSILON); @@ -94,6 +100,7 @@ public final class DecimalComparison { * allowed difference * @return whether they are equal * @since 2019-03-18 + * @since v0.2.0 */ public static final boolean equals(final float a, final float b, final float epsilon) { return Math.abs(a - b) <= epsilon * Math.max(Math.abs(a), Math.abs(b)); |