--- old/src/share/classes/java/lang/Double.java 2011-09-19 18:03:23.000000000 -0700 +++ new/src/share/classes/java/lang/Double.java 2011-09-19 18:03:23.000000000 -0700 @@ -276,7 +276,7 @@ * 7.19.6.1; however, the output of this method is more * tightly specified. */ - if (!FpUtils.isFinite(d) ) + if (!isFinite(d) ) // For infinity and NaN, use the decimal output. return Double.toString(d); else { @@ -548,7 +548,7 @@ * @return {@code true} if the value of the argument is NaN; * {@code false} otherwise. */ - static public boolean isNaN(double v) { + public static boolean isNaN(double v) { return (v != v); } @@ -560,11 +560,25 @@ * @return {@code true} if the value of the argument is positive * infinity or negative infinity; {@code false} otherwise. */ - static public boolean isInfinite(double v) { + public static boolean isInfinite(double v) { return (v == POSITIVE_INFINITY) || (v == NEGATIVE_INFINITY); } /** + * Returns {@code true} if the argument is a finite floating-point + * value; returns {@code false} otherwise (for NaN and infinity + * arguments). + * + * @param d the {@code double} value to be tested + * @return {@code true} if the argument is a finite + * floating-point value, {@code false} otherwise. + * @since 1.8 + */ + public static boolean isFinite(double d) { + return Math.abs(d) <= DoubleConsts.MAX_VALUE; + } + + /** * The value of the Double. * * @serial --- old/src/share/classes/java/lang/Float.java 2011-09-19 18:03:24.000000000 -0700 +++ new/src/share/classes/java/lang/Float.java 2011-09-19 18:03:23.000000000 -0700 @@ -459,7 +459,7 @@ * @return {@code true} if the argument is NaN; * {@code false} otherwise. */ - static public boolean isNaN(float v) { + public static boolean isNaN(float v) { return (v != v); } @@ -471,10 +471,25 @@ * @return {@code true} if the argument is positive infinity or * negative infinity; {@code false} otherwise. */ - static public boolean isInfinite(float v) { + public static boolean isInfinite(float v) { return (v == POSITIVE_INFINITY) || (v == NEGATIVE_INFINITY); } + + /** + * Returns {@code true} if the argument is a finite floating-point + * value; returns {@code false} otherwise (for NaN and infinity + * arguments). + * + * @param f the {@code float} value to be tested + * @return {@code true} if the argument is a finite + * floating-point value, {@code false} otherwise. + * @since 1.8 + */ + public static boolean isFinite(float f) { + return Math.abs(f) <= FloatConsts.MAX_VALUE; + } + /** * The value of the Float. * --- old/src/share/classes/java/lang/Math.java 2011-09-19 18:03:24.000000000 -0700 +++ new/src/share/classes/java/lang/Math.java 2011-09-19 18:03:24.000000000 -0700 @@ -1649,6 +1649,79 @@ } } + /** + * Returns the floating-point value adjacent to {@code d} in + * the direction of negative infinity. This method is + * semantically equivalent to {@code nextAfter(d, + * Double.NEGATIVE_INFINITY)}; however, a + * {@code nextDown} implementation may run faster than its + * equivalent {@code nextAfter} call. + * + *

Special Cases: + *

+ * + * @param d starting floating-point value + * @return The adjacent floating-point value closer to negative + * infinity. + * @since 1.8 + */ + public static double nextDown(double d) { + if (Double.isNaN(d) || d == Double.NEGATIVE_INFINITY) + return d; + else { + if (d == 0.0) + return -Double.MIN_VALUE; + else + return Double.longBitsToDouble(Double.doubleToRawLongBits(d) + + ((d > 0.0d)?-1L:+1L)); + } + } + + /** + * Returns the floating-point value adjacent to {@code f} in + * the direction of negative infinity. This method is + * semantically equivalent to {@code nextAfter(f, + * Float.NEGATIVE_INFINITY)}; however, a + * {@code nextDown} implementation may run faster than its + * equivalent {@code nextAfter} call. + * + *

Special Cases: + *

+ * + * @param f starting floating-point value + * @return The adjacent floating-point value closer to negative + * infinity. + * @since 1.8 + */ + public static double nextDown(float f) { + if (Float.isNaN(f) || f == Float.NEGATIVE_INFINITY) + return f; + else { + if (f == 0.0f) + return -Float.MIN_VALUE; + else + return Float.intBitsToFloat(Float.floatToRawIntBits(f) + + ((f > 0.0f)?-1:+1)); + } + } /** * Return {@code d} × --- old/src/share/classes/java/lang/StrictMath.java 2011-09-19 18:03:25.000000000 -0700 +++ new/src/share/classes/java/lang/StrictMath.java 2011-09-19 18:03:25.000000000 -0700 @@ -1397,6 +1397,64 @@ } /** + * Returns the floating-point value adjacent to {@code d} in + * the direction of negative infinity. This method is + * semantically equivalent to {@code nextAfter(d, + * Double.NEGATIVE_INFINITY)}; however, a + * {@code nextDown} implementation may run faster than its + * equivalent {@code nextAfter} call. + * + *

Special Cases: + *

+ * + * @param d starting floating-point value + * @return The adjacent floating-point value closer to negative + * infinity. + * @since 1.8 + */ + public static double nextDown(double d) { + return Math.nextDown(d); + } + + /** + * Returns the floating-point value adjacent to {@code f} in + * the direction of negative infinity. This method is + * semantically equivalent to {@code nextAfter(f, + * Float.NEGATIVE_INFINITY)}; however, a + * {@code nextDown} implementation may run faster than its + * equivalent {@code nextAfter} call. + * + *

Special Cases: + *

+ * + * @param f starting floating-point value + * @return The adjacent floating-point value closer to negative + * infinity. + * @since 1.8 + */ + public static double nextDown(float f) { + return Math.nextDown(f); + } + + /** * Return {@code d} × * 2{@code scaleFactor} rounded as if performed * by a single correctly rounded floating-point multiply to a --- old/src/share/classes/java/util/Formatter.java 2011-09-19 18:03:26.000000000 -0700 +++ new/src/share/classes/java/util/Formatter.java 2011-09-19 18:03:25.000000000 -0700 @@ -50,7 +50,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import sun.misc.FpUtils; import sun.misc.DoubleConsts; import sun.misc.FormattedFloatingDecimal; @@ -3417,7 +3416,7 @@ // Method assumes that d > 0. private String hexDouble(double d, int prec) { // Let Double.toHexString handle simple cases - if(!FpUtils.isFinite(d) || d == 0.0 || prec == 0 || prec >= 13) + if(!Double.isFinite(d) || d == 0.0 || prec == 0 || prec >= 13) // remove "0x" return Double.toHexString(d).substring(2); else { --- old/src/share/classes/sun/misc/FpUtils.java 2011-09-19 18:03:27.000000000 -0700 +++ new/src/share/classes/sun/misc/FpUtils.java 2011-09-19 18:03:26.000000000 -0700 @@ -202,9 +202,11 @@ * @param d the {@code double} value to be tested * @return {@code true} if the argument is a finite * floating-point value, {@code false} otherwise. + * @deprecated Use Double.isFinite. */ + @Deprecated public static boolean isFinite(double d) { - return Math.abs(d) <= DoubleConsts.MAX_VALUE; + return Double.isFinite(d); } /** @@ -215,9 +217,11 @@ * @param f the {@code float} value to be tested * @return {@code true} if the argument is a finite * floating-point value, {@code false} otherwise. + * @deprecated Use Float.isFinite. */ + @Deprecated public static boolean isFinite(float f) { - return Math.abs(f) <= FloatConsts.MAX_VALUE; + return Float.isFinite(f); } /** @@ -746,17 +750,11 @@ * @return The adjacent floating-point value closer to negative * infinity. * @author Joseph D. Darcy + * @deprecated Use Math.nextDown. */ + @Deprecated public static double nextDown(double d) { - if( isNaN(d) || d == Double.NEGATIVE_INFINITY) - return d; - else { - if (d == 0.0) - return -Double.MIN_VALUE; - else - return Double.longBitsToDouble(Double.doubleToRawLongBits(d) + - ((d > 0.0d)?-1L:+1L)); - } + return Math.nextDown(d); } /** @@ -784,16 +782,9 @@ * infinity. * @author Joseph D. Darcy */ + @Deprecated public static double nextDown(float f) { - if( isNaN(f) || f == Float.NEGATIVE_INFINITY) - return f; - else { - if (f == 0.0f) - return -Float.MIN_VALUE; - else - return Float.intBitsToFloat(Float.floatToRawIntBits(f) + - ((f > 0.0f)?-1:+1)); - } + return Math.nextDown(f); } /** --- old/test/java/lang/Double/ParseHexFloatingPoint.java 2011-09-19 18:03:27.000000000 -0700 +++ new/test/java/lang/Double/ParseHexFloatingPoint.java 2011-09-19 18:03:27.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ import java.util.regex.*; -import sun.misc.FpUtils; import sun.misc.DoubleConsts; public class ParseHexFloatingPoint { @@ -227,7 +226,7 @@ new PairSD("0x1.000000000000001p-1075", Double.MIN_VALUE), // More subnormal rounding tests - new PairSD("0x0.fffffffffffff7fffffp-1022", FpUtils.nextDown(DoubleConsts.MIN_NORMAL)), + new PairSD("0x0.fffffffffffff7fffffp-1022", Math.nextDown(DoubleConsts.MIN_NORMAL)), new PairSD("0x0.fffffffffffff8p-1022", DoubleConsts.MIN_NORMAL), new PairSD("0x0.fffffffffffff800000001p-1022",DoubleConsts.MIN_NORMAL), new PairSD("0x0.fffffffffffff80000000000000001p-1022",DoubleConsts.MIN_NORMAL), @@ -242,10 +241,10 @@ new PairSD("0x1.fffffffffffff8p1023", infinityD), new PairSD("0x1.fffffffffffff8000001p1023", infinityD), - new PairSD("0x1.ffffffffffffep1023", FpUtils.nextDown(Double.MAX_VALUE)), - new PairSD("0x1.ffffffffffffe0000p1023", FpUtils.nextDown(Double.MAX_VALUE)), - new PairSD("0x1.ffffffffffffe8p1023", FpUtils.nextDown(Double.MAX_VALUE)), - new PairSD("0x1.ffffffffffffe7p1023", FpUtils.nextDown(Double.MAX_VALUE)), + new PairSD("0x1.ffffffffffffep1023", Math.nextDown(Double.MAX_VALUE)), + new PairSD("0x1.ffffffffffffe0000p1023", Math.nextDown(Double.MAX_VALUE)), + new PairSD("0x1.ffffffffffffe8p1023", Math.nextDown(Double.MAX_VALUE)), + new PairSD("0x1.ffffffffffffe7p1023", Math.nextDown(Double.MAX_VALUE)), new PairSD("0x1.ffffffffffffeffffffp1023", Double.MAX_VALUE), new PairSD("0x1.ffffffffffffe8000001p1023", Double.MAX_VALUE), }; @@ -284,8 +283,8 @@ }; double [] answers = { - FpUtils.nextDown(FpUtils.nextDown(2.0)), - FpUtils.nextDown(2.0), + Math.nextDown(Math.nextDown(2.0)), + Math.nextDown(2.0), 2.0 }; --- old/test/java/lang/Math/CeilAndFloorTests.java 2011-09-19 18:03:28.000000000 -0700 +++ new/test/java/lang/Math/CeilAndFloorTests.java 2011-09-19 18:03:28.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ * @summary Check for correct implementation of Math.ceil and Math.floor */ -import sun.misc.FpUtils; import sun.misc.DoubleConsts; public class CeilAndFloorTests { @@ -69,7 +68,7 @@ for(int i = Double.MIN_EXPONENT; i <= Double.MAX_EXPONENT; i++) { double powerOfTwo = Math.scalb(1.0, i); - double neighborDown = FpUtils.nextDown(powerOfTwo); + double neighborDown = Math.nextDown(powerOfTwo); double neighborUp = Math.nextUp(powerOfTwo); if (i < 0) { @@ -114,7 +113,7 @@ for(int i = -(0x10000); i <= 0x10000; i++) { double d = (double) i; - double neighborDown = FpUtils.nextDown(d); + double neighborDown = Math.nextDown(d); double neighborUp = Math.nextUp(d); failures += testCeilCase( d, d); @@ -140,8 +139,8 @@ double [][] testCases = { { Double.MIN_VALUE, 1.0}, {-Double.MIN_VALUE, -0.0}, - { FpUtils.nextDown(DoubleConsts.MIN_NORMAL), 1.0}, - {-FpUtils.nextDown(DoubleConsts.MIN_NORMAL), -0.0}, + { Math.nextDown(DoubleConsts.MIN_NORMAL), 1.0}, + {-Math.nextDown(DoubleConsts.MIN_NORMAL), -0.0}, { DoubleConsts.MIN_NORMAL, 1.0}, {-DoubleConsts.MIN_NORMAL, -0.0}, @@ -157,8 +156,8 @@ { 2.5, 3.0}, {-2.5, -2.0}, - { FpUtils.nextDown(1.0), 1.0}, - { FpUtils.nextDown(-1.0), -1.0}, + { Math.nextDown(1.0), 1.0}, + { Math.nextDown(-1.0), -1.0}, { Math.nextUp(1.0), 2.0}, { Math.nextUp(-1.0), -0.0}, @@ -166,17 +165,17 @@ { 0x1.0p51, 0x1.0p51}, {-0x1.0p51, -0x1.0p51}, - { FpUtils.nextDown(0x1.0p51), 0x1.0p51}, + { Math.nextDown(0x1.0p51), 0x1.0p51}, {-Math.nextUp(0x1.0p51), -0x1.0p51}, { Math.nextUp(0x1.0p51), 0x1.0p51+1}, - {-FpUtils.nextDown(0x1.0p51), -0x1.0p51+1}, + {-Math.nextDown(0x1.0p51), -0x1.0p51+1}, - { FpUtils.nextDown(0x1.0p52), 0x1.0p52}, + { Math.nextDown(0x1.0p52), 0x1.0p52}, {-Math.nextUp(0x1.0p52), -0x1.0p52-1.0}, { Math.nextUp(0x1.0p52), 0x1.0p52+1.0}, - {-FpUtils.nextDown(0x1.0p52), -0x1.0p52+1.0}, + {-Math.nextDown(0x1.0p52), -0x1.0p52+1.0}, }; for(double[] testCase : testCases) { --- old/test/java/lang/Math/CubeRootTests.java 2011-09-19 18:03:29.000000000 -0700 +++ new/test/java/lang/Math/CubeRootTests.java 2011-09-19 18:03:28.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ * @author Joseph D. Darcy */ -import sun.misc.FpUtils; import sun.misc.DoubleConsts; public class CubeRootTests { @@ -245,8 +244,8 @@ double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc; - pcNeighbors[1] = FpUtils.nextDown(pc); - pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); + pcNeighbors[1] = Math.nextDown(pc); + pcNeighbors[0] = Math.nextDown(pcNeighbors[1]); pcNeighbors[3] = Math.nextUp(pc); pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); @@ -284,8 +283,8 @@ double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc; - pcNeighbors[1] = FpUtils.nextDown(pc); - pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); + pcNeighbors[1] = Math.nextDown(pc); + pcNeighbors[0] = Math.nextDown(pcNeighbors[1]); pcNeighbors[3] = Math.nextUp(pc); pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); --- old/test/java/lang/Math/Expm1Tests.java 2011-09-19 18:03:29.000000000 -0700 +++ new/test/java/lang/Math/Expm1Tests.java 2011-09-19 18:03:29.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ */ import sun.misc.DoubleConsts; -import sun.misc.FpUtils; /* * The Taylor expansion of expxm1(x) = exp(x) -1 is @@ -143,8 +142,8 @@ double pc = StrictMath.log(2)*i; pcNeighbors[2] = pc; - pcNeighbors[1] = FpUtils.nextDown(pc); - pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); + pcNeighbors[1] = Math.nextDown(pc); + pcNeighbors[0] = Math.nextDown(pcNeighbors[1]); pcNeighbors[3] = Math.nextUp(pc); pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); --- old/test/java/lang/Math/HyperbolicTests.java 2011-09-19 18:03:30.000000000 -0700 +++ new/test/java/lang/Math/HyperbolicTests.java 2011-09-19 18:03:30.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ */ import sun.misc.DoubleConsts; -import sun.misc.FpUtils; public class HyperbolicTests { private HyperbolicTests(){} @@ -280,7 +279,7 @@ long trans22 = Double.doubleToLongBits(22.0); // (approximately) largest value such that exp shouldn't // overflow - long transExpOvfl = Double.doubleToLongBits(FpUtils.nextDown(709.7827128933841)); + long transExpOvfl = Double.doubleToLongBits(Math.nextDown(709.7827128933841)); for(long i = trans22; i < transExpOvfl; @@ -639,7 +638,7 @@ long trans22 = Double.doubleToLongBits(22.0); // (approximately) largest value such that exp shouldn't // overflow - long transExpOvfl = Double.doubleToLongBits(FpUtils.nextDown(709.7827128933841)); + long transExpOvfl = Double.doubleToLongBits(Math.nextDown(709.7827128933841)); for(long i = trans22; i < transExpOvfl; --- old/test/java/lang/Math/HypotTests.java 2011-09-19 18:03:31.000000000 -0700 +++ new/test/java/lang/Math/HypotTests.java 2011-09-19 18:03:30.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -156,8 +156,8 @@ double pc = Math.scalb(1.0, i); pcNeighbors[2] = pc; - pcNeighbors[1] = FpUtils.nextDown(pc); - pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); + pcNeighbors[1] = Math.nextDown(pc); + pcNeighbors[0] = Math.nextDown(pcNeighbors[1]); pcNeighbors[3] = Math.nextUp(pc); pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); --- old/test/java/lang/Math/IeeeRecommendedTests.java 2011-09-19 18:03:31.000000000 -0700 +++ new/test/java/lang/Math/IeeeRecommendedTests.java 2011-09-19 18:03:31.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -623,8 +623,11 @@ }; for(int i = 0; i < testCases.length; i++) { - failures+=Tests.test("FpUtils.nextDown(float)", - testCases[i][0], FpUtils.nextDown(testCases[i][0]), testCases[i][1]); + failures+=Tests.test("Math.nextDown(float)", + testCases[i][0], Math.nextDown(testCases[i][0]), testCases[i][1]); + + failures+=Tests.test("StrictMath.nextDown(float)", + testCases[i][0], StrictMath.nextDown(testCases[i][0]), testCases[i][1]); } return failures; @@ -659,8 +662,11 @@ }; for(int i = 0; i < testCases.length; i++) { - failures+=Tests.test("FpUtils.nextDown(double)", - testCases[i][0], FpUtils.nextDown(testCases[i][0]), testCases[i][1]); + failures+=Tests.test("Math.nextDown(double)", + testCases[i][0], Math.nextDown(testCases[i][0]), testCases[i][1]); + + failures+=Tests.test("StrictMath.nextDown(double)", + testCases[i][0], StrictMath.nextDown(testCases[i][0]), testCases[i][1]); } return failures; @@ -706,8 +712,8 @@ FpUtils.isNaN(testCases[i]), (i ==0)); // isFinite - failures+=Tests.test("FpUtils.isFinite(float)", testCases[i], - FpUtils.isFinite(testCases[i]), (i >= 3)); + failures+=Tests.test("Float.isFinite(float)", testCases[i], + Float.isFinite(testCases[i]), (i >= 3)); // isInfinite failures+=Tests.test("FpUtils.isInfinite(float)", testCases[i], @@ -756,8 +762,8 @@ FpUtils.isNaN(testCases[i]), (i ==0)); // isFinite - failures+=Tests.test("FpUtils.isFinite(double)", testCases[i], - FpUtils.isFinite(testCases[i]), (i >= 3)); + failures+=Tests.test("Double.isFinite(double)", testCases[i], + Double.isFinite(testCases[i]), (i >= 3)); // isInfinite failures+=Tests.test("FpUtils.isInfinite(double)", testCases[i], --- old/test/java/lang/Math/Log10Tests.java 2011-09-19 18:03:32.000000000 -0700 +++ new/test/java/lang/Math/Log10Tests.java 2011-09-19 18:03:32.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ * @author Joseph D. Darcy */ -import sun.misc.FpUtils; import sun.misc.DoubleConsts; public class Log10Tests { @@ -98,13 +97,13 @@ // within a few ulps of log(x)/log(10) for(int i = 0; i < 10000; i++) { double input = Double.longBitsToDouble(rand.nextLong()); - if(! FpUtils.isFinite(input)) + if(! Double.isFinite(input)) continue; // avoid testing NaN and infinite values else { input = Math.abs(input); double expected = StrictMath.log(input)/LN_10; - if( ! FpUtils.isFinite(expected)) + if( ! Double.isFinite(expected)) continue; // if log(input) overflowed, try again else { double result; @@ -154,15 +153,15 @@ if (i == 0) { input[half] = 1.0; up = Math.nextUp(1.0); - down = FpUtils.nextDown(1.0); + down = Math.nextDown(1.0); } else { input[half + i] = up; input[half - i] = down; up = Math.nextUp(up); - down = FpUtils.nextDown(down); + down = Math.nextDown(down); } } - input[0] = FpUtils.nextDown(input[1]); + input[0] = Math.nextDown(input[1]); for(int i = 0; i < neighbors.length; i++) { neighbors[i] = Math.log10(input[i]); --- old/test/java/lang/Math/Log1pTests.java 2011-09-19 18:03:33.000000000 -0700 +++ new/test/java/lang/Math/Log1pTests.java 2011-09-19 18:03:32.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,8 +135,8 @@ double pc = StrictMath.pow(Math.E, i) - 1; pcNeighbors[2] = pc; - pcNeighbors[1] = FpUtils.nextDown(pc); - pcNeighbors[0] = FpUtils.nextDown(pcNeighbors[1]); + pcNeighbors[1] = Math.nextDown(pc); + pcNeighbors[0] = Math.nextDown(pcNeighbors[1]); pcNeighbors[3] = Math.nextUp(pc); pcNeighbors[4] = Math.nextUp(pcNeighbors[3]); @@ -202,5 +202,4 @@ throw new RuntimeException(); } } - } --- old/test/java/lang/Math/Rint.java 2011-09-19 18:03:33.000000000 -0700 +++ new/test/java/lang/Math/Rint.java 2011-09-19 18:03:33.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,8 @@ * @test * @bug 4101566 4831589 * @summary Check for correct implementation of Math.rint(double) - * */ -import sun.misc.FpUtils; import sun.misc.DoubleConsts; public class Rint { @@ -53,22 +51,22 @@ double [][] testCases = { {0.0, 0.0}, {Double.MIN_VALUE, 0.0}, - {FpUtils.nextDown(DoubleConsts.MIN_NORMAL), 0.0}, + {Math.nextDown(DoubleConsts.MIN_NORMAL), 0.0}, {DoubleConsts.MIN_NORMAL, 0.0}, {0.2, 0.0}, - {FpUtils.nextDown(0.5), 0.0}, - { 0.5, 0.0}, + {Math.nextDown(0.5), 0.0}, + { 0.5, 0.0}, { Math.nextUp(0.5), 1.0}, {0.7, 1.0}, - {FpUtils.nextDown(1.0), 1.0}, - { 1.0, 1.0}, + {Math.nextDown(1.0), 1.0}, + { 1.0, 1.0}, { Math.nextUp(1.0), 1.0}, - {FpUtils.nextDown(1.5), 1.0}, - { 1.5, 2.0}, + {Math.nextDown(1.5), 1.0}, + { 1.5, 2.0}, { Math.nextUp(1.5), 2.0}, {4.2, 4.0}, @@ -82,7 +80,7 @@ {150000.75, 150001.0}, {300000.5, 300000.0}, {Math.nextUp(300000.5), 300001.0}, - {FpUtils.nextDown(300000.75), 300001.0}, + {Math.nextDown(300000.75), 300001.0}, {300000.75, 300001.0}, {Math.nextUp(300000.75), 300001.0}, {300000.99, 300001.0}, @@ -91,7 +89,7 @@ {524287.75, 524288.0}, //(2^19 -1) + 0.75 {524288.75, 524289.0}, - {FpUtils.nextDown(twoToThe52), twoToThe52}, + {Math.nextDown(twoToThe52), twoToThe52}, {twoToThe52, twoToThe52}, {Math.nextUp(twoToThe52), Math.nextUp(twoToThe52)}, @@ -118,5 +116,4 @@ throw new RuntimeException(); } } - } --- old/test/java/util/Formatter/Basic-X.java.template 2011-09-19 18:03:34.000000000 -0700 +++ new/test/java/util/Formatter/Basic-X.java.template 2011-09-19 18:03:34.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ import java.text.DateFormatSymbols; import java.util.*; #if[double] -import sun.misc.FpUtils; import sun.misc.DoubleConsts; #end[double] @@ -1301,9 +1300,9 @@ test("%.11a", "0x1.00000000000p-1022", DoubleConsts.MIN_NORMAL); test("%.1a", "0x1.0p-1022", DoubleConsts.MIN_NORMAL); test("%.11a", "0x1.00000000000p-1022", - FpUtils.nextDown(DoubleConsts.MIN_NORMAL)); + Math.nextDown(DoubleConsts.MIN_NORMAL)); test("%.1a", "0x1.0p-1022", - FpUtils.nextDown(DoubleConsts.MIN_NORMAL)); + Math.nextDown(DoubleConsts.MIN_NORMAL)); test("%.11a", "0x1.ffffffffffep-1023", Double.parseDouble("0x0.fffffffffffp-1022")); test("%.1a", "0x1.0p-1022", --- old/test/java/util/Formatter/BasicBigDecimal.java 2011-09-19 18:03:35.000000000 -0700 +++ new/test/java/util/Formatter/BasicBigDecimal.java 2011-09-19 18:03:34.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicBigInteger.java 2011-09-19 18:03:35.000000000 -0700 +++ new/test/java/util/Formatter/BasicBigInteger.java 2011-09-19 18:03:35.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicBoolean.java 2011-09-19 18:03:36.000000000 -0700 +++ new/test/java/util/Formatter/BasicBoolean.java 2011-09-19 18:03:36.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicBooleanObject.java 2011-09-19 18:03:36.000000000 -0700 +++ new/test/java/util/Formatter/BasicBooleanObject.java 2011-09-19 18:03:36.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicByte.java 2011-09-19 18:03:37.000000000 -0700 +++ new/test/java/util/Formatter/BasicByte.java 2011-09-19 18:03:37.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicByteObject.java 2011-09-19 18:03:38.000000000 -0700 +++ new/test/java/util/Formatter/BasicByteObject.java 2011-09-19 18:03:37.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicChar.java 2011-09-19 18:03:38.000000000 -0700 +++ new/test/java/util/Formatter/BasicChar.java 2011-09-19 18:03:38.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicCharObject.java 2011-09-19 18:03:39.000000000 -0700 +++ new/test/java/util/Formatter/BasicCharObject.java 2011-09-19 18:03:39.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicDateTime.java 2011-09-19 18:03:40.000000000 -0700 +++ new/test/java/util/Formatter/BasicDateTime.java 2011-09-19 18:03:39.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; import static java.util.SimpleTimeZone.*; --- old/test/java/util/Formatter/BasicDouble.java 2011-09-19 18:03:40.000000000 -0700 +++ new/test/java/util/Formatter/BasicDouble.java 2011-09-19 18:03:40.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ import java.text.DateFormatSymbols; import java.util.*; -import sun.misc.FpUtils; import sun.misc.DoubleConsts; @@ -1301,9 +1300,9 @@ test("%.11a", "0x1.00000000000p-1022", DoubleConsts.MIN_NORMAL); test("%.1a", "0x1.0p-1022", DoubleConsts.MIN_NORMAL); test("%.11a", "0x1.00000000000p-1022", - FpUtils.nextDown(DoubleConsts.MIN_NORMAL)); + Math.nextDown(DoubleConsts.MIN_NORMAL)); test("%.1a", "0x1.0p-1022", - FpUtils.nextDown(DoubleConsts.MIN_NORMAL)); + Math.nextDown(DoubleConsts.MIN_NORMAL)); test("%.11a", "0x1.ffffffffffep-1023", Double.parseDouble("0x0.fffffffffffp-1022")); test("%.1a", "0x1.0p-1022", --- old/test/java/util/Formatter/BasicDoubleObject.java 2011-09-19 18:03:41.000000000 -0700 +++ new/test/java/util/Formatter/BasicDoubleObject.java 2011-09-19 18:03:41.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicFloat.java 2011-09-19 18:03:42.000000000 -0700 +++ new/test/java/util/Formatter/BasicFloat.java 2011-09-19 18:03:41.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicFloatObject.java 2011-09-19 18:03:42.000000000 -0700 +++ new/test/java/util/Formatter/BasicFloatObject.java 2011-09-19 18:03:42.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicInt.java 2011-09-19 18:03:43.000000000 -0700 +++ new/test/java/util/Formatter/BasicInt.java 2011-09-19 18:03:43.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicIntObject.java 2011-09-19 18:03:44.000000000 -0700 +++ new/test/java/util/Formatter/BasicIntObject.java 2011-09-19 18:03:43.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicLong.java 2011-09-19 18:03:44.000000000 -0700 +++ new/test/java/util/Formatter/BasicLong.java 2011-09-19 18:03:44.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicLongObject.java 2011-09-19 18:03:45.000000000 -0700 +++ new/test/java/util/Formatter/BasicLongObject.java 2011-09-19 18:03:45.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicShort.java 2011-09-19 18:03:46.000000000 -0700 +++ new/test/java/util/Formatter/BasicShort.java 2011-09-19 18:03:45.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*; --- old/test/java/util/Formatter/BasicShortObject.java 2011-09-19 18:03:46.000000000 -0700 +++ new/test/java/util/Formatter/BasicShortObject.java 2011-09-19 18:03:46.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ - import static java.util.Calendar.*;