diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:40:41 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:40:41 -0400 |
| commit | d4ca769e542b2489b1e23cfcbdc3a0b7275b87cd (patch) | |
| tree | 1653a7399f97fb0c63ce62e3f60fd830d5c37f70 /base/src/main/java/bjc/utils/math/Dual.java | |
| parent | 2ac2e31a56ae59ee582e43a90c3495f86dd9ee7a (diff) | |
Cleanup pass
Cleanup pass to uniformize things
Diffstat (limited to 'base/src/main/java/bjc/utils/math/Dual.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/math/Dual.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/base/src/main/java/bjc/utils/math/Dual.java b/base/src/main/java/bjc/utils/math/Dual.java index 7eea6a9..4a81e8a 100644 --- a/base/src/main/java/bjc/utils/math/Dual.java +++ b/base/src/main/java/bjc/utils/math/Dual.java @@ -3,8 +3,8 @@ package bjc.utils.math; /** * Represents a 'dual' number. * - * Think imaginary numbers, where instead of i, we add a value d such that - * d^2 = 0. + * Think imaginary numbers, where instead of i, we add a value d such that d^2 = + * 0. */ public class Dual { /** @@ -28,7 +28,7 @@ public class Dual { * Create a new dual number with a zero dual part. * * @param real - * The real part of the number. + * The real part of the number. */ public Dual(double real) { this.real = real; @@ -39,9 +39,9 @@ public class Dual { * Create a new dual number with a specified dual part. * * @param real - * The real part of the number. + * The real part of the number. * @param dual - * The dual part of the number. + * The dual part of the number. */ public Dual(double real, double dual) { this.real = real; @@ -67,12 +67,17 @@ public class Dual { @Override public boolean equals(Object obj) { - if(this == obj) return true; - if(obj == null) return false; - if(getClass() != obj.getClass()) return false; + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; Dual other = (Dual) obj; - if(Double.doubleToLongBits(dual) != Double.doubleToLongBits(other.dual)) return false; - if(Double.doubleToLongBits(real) != Double.doubleToLongBits(other.real)) return false; + if (Double.doubleToLongBits(dual) != Double.doubleToLongBits(other.dual)) + return false; + if (Double.doubleToLongBits(real) != Double.doubleToLongBits(other.real)) + return false; return true; } } |
