src/share/classes/java/lang/Float.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1994, 2012, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1994, 2013, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 201,211 **** * * @param f the float to be converted. * @return a string representation of the argument. */ public static String toString(float f) { ! return new FloatingDecimal(f).toJavaFormatString(); } /** * Returns a hexadecimal string representation of the * {@code float} argument. All characters mentioned below are --- 201,211 ---- * * @param f the float to be converted. * @return a string representation of the argument. */ public static String toString(float f) { ! return FloatingDecimal.toJavaFormatString(f); } /** * Returns a hexadecimal string representation of the * {@code float} argument. All characters mentioned below are
*** 419,429 **** * represented by the {@code String} argument. * @throws NumberFormatException if the string does not contain a * parsable number. */ public static Float valueOf(String s) throws NumberFormatException { ! return new Float(FloatingDecimal.readJavaFormatString(s).floatValue()); } /** * Returns a {@code Float} instance representing the specified * {@code float} value. --- 419,429 ---- * represented by the {@code String} argument. * @throws NumberFormatException if the string does not contain a * parsable number. */ public static Float valueOf(String s) throws NumberFormatException { ! return new Float(parseFloat(s)); } /** * Returns a {@code Float} instance representing the specified * {@code float} value.
*** 454,464 **** * parsable {@code float}. * @see java.lang.Float#valueOf(String) * @since 1.2 */ public static float parseFloat(String s) throws NumberFormatException { ! return FloatingDecimal.readJavaFormatString(s).floatValue(); } /** * Returns {@code true} if the specified number is a * Not-a-Number (NaN) value, {@code false} otherwise. --- 454,464 ---- * parsable {@code float}. * @see java.lang.Float#valueOf(String) * @since 1.2 */ public static float parseFloat(String s) throws NumberFormatException { ! return FloatingDecimal.parseFloat(s); } /** * Returns {@code true} if the specified number is a * Not-a-Number (NaN) value, {@code false} otherwise.