Added (trivial) tests for NaNs.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1092402 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2011-04-14 17:37:36 +00:00
parent 2bc9b4b4d1
commit 00e957d447
1 changed files with 8 additions and 0 deletions

View File

@ -461,6 +461,10 @@ public final class MathUtilsTest {
Assert.assertTrue(MathUtils.equals(-Float.MAX_VALUE, Float.NEGATIVE_INFINITY, 1));
Assert.assertFalse(MathUtils.equals(Float.NaN, Float.NaN, 1));
Assert.assertFalse(MathUtils.equals(Float.NaN, Float.NaN, 0));
Assert.assertFalse(MathUtils.equals(Float.NaN, 0, 0));
Assert.assertFalse(MathUtils.equals(Float.NaN, Float.POSITIVE_INFINITY, 0));
Assert.assertFalse(MathUtils.equals(Float.NaN, Float.NEGATIVE_INFINITY, 0));
Assert.assertFalse(MathUtils.equals(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, 100000));
}
@ -500,6 +504,10 @@ public final class MathUtilsTest {
Assert.assertTrue(MathUtils.equals(-Double.MAX_VALUE, Double.NEGATIVE_INFINITY, 1));
Assert.assertFalse(MathUtils.equals(Double.NaN, Double.NaN, 1));
Assert.assertFalse(MathUtils.equals(Double.NaN, Double.NaN, 0));
Assert.assertFalse(MathUtils.equals(Double.NaN, 0, 0));
Assert.assertFalse(MathUtils.equals(Double.NaN, Double.POSITIVE_INFINITY, 0));
Assert.assertFalse(MathUtils.equals(Double.NaN, Double.NEGATIVE_INFINITY, 0));
Assert.assertFalse(MathUtils.equals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 100000));
}