MATH-1581: Removed "equals" method.
This commit is contained in:
parent
f885cb029f
commit
eedd0b853b
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue