mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8295391: Add discussion of binary <-> decimal conversion issues
Reviewed-by: bpb
This commit is contained in:
parent
99570fbe76
commit
8ff7d6ea0a
2 changed files with 157 additions and 3 deletions
|
@ -56,11 +56,17 @@ import jdk.internal.vm.annotation.IntrinsicCandidate;
|
|||
* <h2><a id=equivalenceRelation>Floating-point Equality, Equivalence,
|
||||
* and Comparison</a></h2>
|
||||
*
|
||||
* The class {@code java.lang.Double} has a <a
|
||||
* href="Double.html#equivalenceRelation">discussion of equality,
|
||||
* equivalence, and comparison of floating-point values</a> that is
|
||||
* The class {@code java.lang.Double} has a {@linkplain
|
||||
* Double##equivalenceRelation discussion of equality,
|
||||
* equivalence, and comparison of floating-point values} that is
|
||||
* equally applicable to {@code float} values.
|
||||
*
|
||||
* <h2><a id=decimalToBinaryConversion>Decimal ↔ Binary Conversion Issues</a></h2>
|
||||
*
|
||||
* The {@linkplain Double##decimalToBinaryConversion discussion of binary to
|
||||
* decimal conversion issues} in {@code java.lang.Double} is also
|
||||
* applicable to {@code float} values.
|
||||
*
|
||||
* @see <a href="https://standards.ieee.org/ieee/754/6210/">
|
||||
* <cite>IEEE Standard for Floating-Point Arithmetic</cite></a>
|
||||
*
|
||||
|
@ -515,6 +521,7 @@ public final class Float extends Number
|
|||
* represented by the {@code String} argument.
|
||||
* @throws NumberFormatException if the string does not contain a
|
||||
* parsable number.
|
||||
* @see Double##decimalToBinaryConversion Decimal ↔ Binary Conversion Issues
|
||||
*/
|
||||
public static Float valueOf(String s) throws NumberFormatException {
|
||||
return new Float(parseFloat(s));
|
||||
|
@ -550,6 +557,7 @@ public final class Float extends Number
|
|||
* @throws NumberFormatException if the string does not contain a
|
||||
* parsable {@code float}.
|
||||
* @see java.lang.Float#valueOf(String)
|
||||
* @see Double##decimalToBinaryConversion Decimal ↔ Binary Conversion Issues
|
||||
* @since 1.2
|
||||
*/
|
||||
public static float parseFloat(String s) throws NumberFormatException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue