Usage of factory method is recommended.

Thanks to "ranjan1423".

Closes #165.
This commit is contained in:
Gilles Sadowski 2020-11-16 14:42:13 +01:00
parent 2da7454c57
commit a33cc0b142
1 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ public final class MathUtils {
* @return the hash code * @return the hash code
*/ */
public static int hash(double value) { public static int hash(double value) {
return new Double(value).hashCode(); return Double.valueOf(value).hashCode();
} }
/** /**
@ -68,10 +68,10 @@ public final class MathUtils {
* *
* @param x Value * @param x Value
* @param y Value * @param y Value
* @return {@code new Double(x).equals(new Double(y))} * @return {@code Double.valueOf(x).equals(Double.valueOf(y))}
*/ */
public static boolean equals(double x, double y) { public static boolean equals(double x, double y) {
return new Double(x).equals(new Double(y)); return Double.valueOf(x).equals(Double.valueOf(y));
} }
/** /**