aboutsummaryrefslogtreecommitdiff
path: root/src/java.base/share/classes/java/math/MathContext.java
diff options
context:
space:
mode:
authorJoe Darcy <darcy@openjdk.org>2021-03-08 22:30:11 +0000
committerJoe Darcy <darcy@openjdk.org>2021-03-08 22:30:11 +0000
commit14cfbda39e44763b2d0d47e0cc6b85a81df02fa8 (patch)
tree1c250fe9d09256f8f98e53e5090a6e0cdbe8cdb7 /src/java.base/share/classes/java/math/MathContext.java
parent414ee95b8ebfcc06a10d76b782ebbe452d8f738d (diff)
downloadopenjdk-14cfbda39e44763b2d0d47e0cc6b85a81df02fa8.tar.gz
openjdk-14cfbda39e44763b2d0d47e0cc6b85a81df02fa8.zip
8261366: Add discussion of IEEE 754 to BigDecimal
Reviewed-by: bpb
Diffstat (limited to 'src/java.base/share/classes/java/math/MathContext.java')
-rw-r--r--src/java.base/share/classes/java/math/MathContext.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/java.base/share/classes/java/math/MathContext.java b/src/java.base/share/classes/java/math/MathContext.java
index 028ede34de6..212f628b009 100644
--- a/src/java.base/share/classes/java/math/MathContext.java
+++ b/src/java.base/share/classes/java/math/MathContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2021, 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
@@ -69,39 +69,39 @@ public final class MathContext implements Serializable {
/* ----- Public Properties ----- */
/**
- * A {@code MathContext} object whose settings have the values
- * required for unlimited precision arithmetic.
- * The values of the settings are:
- * <code>
- * precision=0 roundingMode=HALF_UP
- * </code>
+ * A {@code MathContext} object whose settings have the values
+ * required for unlimited precision arithmetic.
+ * The values of the settings are: {@code precision=0 roundingMode=HALF_UP}
*/
public static final MathContext UNLIMITED =
new MathContext(0, RoundingMode.HALF_UP);
/**
- * A {@code MathContext} object with a precision setting
- * matching the IEEE 754R Decimal32 format, 7 digits, and a
- * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}, the
- * IEEE 754R default.
+ * A {@code MathContext} object with a precision setting
+ * matching the precision of the IEEE 754-2019 decimal32 format, 7 digits, and a
+ * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}.
+ * Note the exponent range of decimal32 is <em>not</em> used for
+ * rounding.
*/
public static final MathContext DECIMAL32 =
new MathContext(7, RoundingMode.HALF_EVEN);
/**
- * A {@code MathContext} object with a precision setting
- * matching the IEEE 754R Decimal64 format, 16 digits, and a
- * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}, the
- * IEEE 754R default.
+ * A {@code MathContext} object with a precision setting
+ * matching the precision of the IEEE 754-2019 decimal64 format, 16 digits, and a
+ * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}.
+ * Note the exponent range of decimal64 is <em>not</em> used for
+ * rounding.
*/
public static final MathContext DECIMAL64 =
new MathContext(16, RoundingMode.HALF_EVEN);
/**
- * A {@code MathContext} object with a precision setting
- * matching the IEEE 754R Decimal128 format, 34 digits, and a
- * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}, the
- * IEEE 754R default.
+ * A {@code MathContext} object with a precision setting
+ * matching the precision of the IEEE 754-2019 decimal128 format, 34 digits, and a
+ * rounding mode of {@link RoundingMode#HALF_EVEN HALF_EVEN}.
+ * Note the exponent range of decimal64 is <em>not</em> used for
+ * rounding.
*/
public static final MathContext DECIMAL128 =
new MathContext(34, RoundingMode.HALF_EVEN);