src/share/classes/java/lang/Double.java
Print this page
@@ -199,11 +199,11 @@
*
* @param d the {@code double} to be converted.
* @return a string representation of the argument.
*/
public static String toString(double d) {
- return new FloatingDecimal(d).toJavaFormatString();
+ return FloatingDecimal.toJavaFormatString(d);
}
/**
* Returns a hexadecimal string representation of the
* {@code double} argument. All characters mentioned below
@@ -507,11 +507,11 @@
* represented by the {@code String} argument.
* @throws NumberFormatException if the string does not contain a
* parsable number.
*/
public static Double valueOf(String s) throws NumberFormatException {
- return new Double(FloatingDecimal.readJavaFormatString(s).doubleValue());
+ return new Double(parseDouble(s));
}
/**
* Returns a {@code Double} instance representing the specified
* {@code double} value.
@@ -543,11 +543,11 @@
* a parsable {@code double}.
* @see java.lang.Double#valueOf(String)
* @since 1.2
*/
public static double parseDouble(String s) throws NumberFormatException {
- return FloatingDecimal.readJavaFormatString(s).doubleValue();
+ return FloatingDecimal.parseDouble(s);
}
/**
* Returns {@code true} if the specified number is a
* Not-a-Number (NaN) value, {@code false} otherwise.