--- old/src/share/classes/java/lang/Double.java 2011-09-20 09:20:28.000000000 -0700 +++ new/src/share/classes/java/lang/Double.java 2011-09-20 09:20:28.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