MATH-1581: Removed "equals" method.

This commit is contained in:
Gilles Sadowski 2021-05-26 00:17:56 +02:00
parent f885cb029f
commit eedd0b853b
2 changed files with 0 additions and 29 deletions

View File

@ -51,18 +51,6 @@ public final class MathUtils {
*/
private MathUtils() {}
/**
* Returns {@code true} if the values are equal according to semantics of
* {@link Double#equals(Object)}.
*
* @param x Value
* @param y Value
* @return {@code Double.valueOf(x).equals(Double.valueOf(y))}
*/
public static boolean equals(double x, double y) {
return Double.valueOf(x).equals(Double.valueOf(y));
}
/** Find the maximum of two field elements.
* @param <T> the type of the field elements
* @param e1 first element

View File

@ -31,23 +31,6 @@ import org.junit.Test;
*
*/
public final class MathUtilsTest {
@Test
public void testEqualsDouble() {
final double x = 1234.5678;
Assert.assertTrue(MathUtils.equals(x, x));
Assert.assertFalse(MathUtils.equals(x, -x));
// Special cases (cf. semantics of JDK's "Double").
// 1. NaN
Assert.assertTrue(MathUtils.equals(Double.NaN, Double.NaN));
// 2. Negative zero
final double mZero = -0d;
final double zero = 0d;
Assert.assertTrue(MathUtils.equals(zero, zero));
Assert.assertTrue(MathUtils.equals(mZero, mZero));
Assert.assertFalse(MathUtils.equals(mZero, zero));
}
@Test
public void testReduce() {
final double period = -12.222;