src/share/classes/sun/misc/FpUtils.java

Print this page

        

*** 200,225 **** * 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. */ public static boolean isFinite(double d) { ! return Math.abs(d) <= DoubleConsts.MAX_VALUE; } /** * 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. */ public static boolean isFinite(float f) { ! return Math.abs(f) <= FloatConsts.MAX_VALUE; } /** * Returns {@code true} if the specified number is infinitely * large in magnitude, {@code false} otherwise. --- 200,229 ---- * 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. + * @deprecated Use Double.isFinite. */ + @Deprecated public static boolean isFinite(double d) { ! return Double.isFinite(d); } /** * 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. + * @deprecated Use Float.isFinite. */ + @Deprecated public static boolean isFinite(float f) { ! return Float.isFinite(f); } /** * Returns {@code true} if the specified number is infinitely * large in magnitude, {@code false} otherwise.
*** 744,764 **** * * @param d starting floating-point value * @return The adjacent floating-point value closer to negative * infinity. * @author Joseph D. Darcy */ 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)); ! } } /** * Returns the floating-point value adjacent to {@code f} in * the direction of negative infinity. This method is --- 748,762 ---- * * @param d starting floating-point value * @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) { ! return Math.nextDown(d); } /** * Returns the floating-point value adjacent to {@code f} in * the direction of negative infinity. This method is
*** 782,801 **** * @param f starting floating-point value * @return The adjacent floating-point value closer to negative * infinity. * @author Joseph D. Darcy */ 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)); ! } } /** * Returns the first floating-point argument with the sign of the * second floating-point argument. For this method, a NaN --- 780,792 ---- * @param f starting floating-point value * @return The adjacent floating-point value closer to negative * infinity. * @author Joseph D. Darcy */ + @Deprecated public static double nextDown(float f) { ! return Math.nextDown(f); } /** * Returns the first floating-point argument with the sign of the * second floating-point argument. For this method, a NaN