On 21 January 2011 08:25, Luc Maisonobe <[email protected]> wrote: > Le 21/01/2011 03:45, [email protected] a écrit : >> Author: sebb >> Date: Fri Jan 21 02:45:52 2011 >> New Revision: 1061602 >> >> URL: http://svn.apache.org/viewvc?rev=1061602&view=rev >> Log: >> Fix up double nextAfter special cases; add float test > > Ooops. I forgot these ones, sorry. > Thanks for fixing that, sebb.
No problem - it was Continuum that noticed the failures initially. > Luc > >> >> Modified: >> >> commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java >> >> Modified: >> commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java >> URL: >> http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java?rev=1061602&r1=1061601&r2=1061602&view=diff >> ============================================================================== >> --- >> commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java >> (original) >> +++ >> commons/proper/math/trunk/src/test/java/org/apache/commons/math/util/MathUtilsTest.java >> Fri Jan 21 02:45:52 2011 >> @@ -1021,16 +1021,28 @@ public final class MathUtilsTest extends >> >> } >> >> - public void testNextAfterSpecialCases() { >> - >> assertTrue(Double.isInfinite(FastMath.nextAfter(Double.NEGATIVE_INFINITY, >> 0))); >> - >> assertTrue(Double.isInfinite(FastMath.nextAfter(Double.POSITIVE_INFINITY, >> 0))); >> - assertTrue(Double.isNaN(FastMath.nextAfter(Double.NaN, 0))); >> - assertTrue(Double.isInfinite(FastMath.nextAfter(Double.MAX_VALUE, >> Double.POSITIVE_INFINITY))); >> - assertTrue(Double.isInfinite(FastMath.nextAfter(-Double.MAX_VALUE, >> Double.NEGATIVE_INFINITY))); >> - assertEquals(Double.MIN_VALUE, FastMath.nextAfter(0, 1), 0); >> - assertEquals(-Double.MIN_VALUE, FastMath.nextAfter(0, -1), 0); >> - assertEquals(0, FastMath.nextAfter(Double.MIN_VALUE, -1), 0); >> - assertEquals(0, FastMath.nextAfter(-Double.MIN_VALUE, 1), 0); >> + public void testDoubleNextAfterSpecialCases() { >> + >> assertEquals(-Double.MAX_VALUE,FastMath.nextAfter(Double.NEGATIVE_INFINITY, >> 0D)); >> + >> assertEquals(Double.MAX_VALUE,FastMath.nextAfter(Double.POSITIVE_INFINITY, >> 0D)); >> + assertEquals(Double.NaN,FastMath.nextAfter(Double.NaN, 0D)); >> + >> assertEquals(Double.POSITIVE_INFINITY,FastMath.nextAfter(Double.MAX_VALUE, >> Double.POSITIVE_INFINITY)); >> + >> assertEquals(Double.NEGATIVE_INFINITY,FastMath.nextAfter(-Double.MAX_VALUE, >> Double.NEGATIVE_INFINITY)); >> + assertEquals(Double.MIN_VALUE, FastMath.nextAfter(0D, 1D), 0D); >> + assertEquals(-Double.MIN_VALUE, FastMath.nextAfter(0D, -1D), 0D); >> + assertEquals(0D, FastMath.nextAfter(Double.MIN_VALUE, -1), 0D); >> + assertEquals(0D, FastMath.nextAfter(-Double.MIN_VALUE, 1), 0D); >> + } >> + >> + public void testFloatNextAfterSpecialCases() { >> + >> assertEquals(-Float.MAX_VALUE,FastMath.nextAfter(Float.NEGATIVE_INFINITY, >> 0F)); >> + >> assertEquals(Float.MAX_VALUE,FastMath.nextAfter(Float.POSITIVE_INFINITY, >> 0F)); >> + assertEquals(Float.NaN,FastMath.nextAfter(Float.NaN, 0F)); >> + >> assertEquals(Float.POSITIVE_INFINITY,FastMath.nextAfter(Float.MAX_VALUE, >> Float.POSITIVE_INFINITY)); >> + >> assertEquals(Float.NEGATIVE_INFINITY,FastMath.nextAfter(-Float.MAX_VALUE, >> Float.NEGATIVE_INFINITY)); >> + assertEquals(Float.MIN_VALUE, FastMath.nextAfter(0F, 1F), 0F); >> + assertEquals(-Float.MIN_VALUE, FastMath.nextAfter(0F, -1F), 0F); >> + assertEquals(0F, FastMath.nextAfter(Float.MIN_VALUE, -1F), 0F); >> + assertEquals(0F, FastMath.nextAfter(-Float.MIN_VALUE, 1F), 0F); >> } >> >> public void testScalb() { >> >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
