< prev index next >
src/java.base/share/classes/java/math/BigDecimal.java
Print this page
8247782: typos in java.math
Reviewed-by: rriggs, lancea, darcy
*** 932,942 ****
: (valBits & ((1L << 52) - 1)) | (1L << 52));
exponent -= 1075;
// At this point, val == sign * significand * 2**exponent.
/*
! * Special case zero to supress nonterminating normalization and bogus
* scale calculation.
*/
if (significand == 0) {
this.intVal = BigInteger.ZERO;
this.scale = 0;
--- 932,942 ----
: (valBits & ((1L << 52) - 1)) | (1L << 52));
exponent -= 1075;
// At this point, val == sign * significand * 2**exponent.
/*
! * Special case zero to suppress nonterminating normalization and bogus
* scale calculation.
*/
if (significand == 0) {
this.intVal = BigInteger.ZERO;
this.scale = 0;
*** 4050,4060 ****
pows = Arrays.copyOf(pows, newLen);
for (int i = curLen; i < newLen; i++) {
pows[i] = pows[i - 1].multiply(BigInteger.TEN);
}
// Based on the following facts:
! // 1. pows is a private local varible;
// 2. the following store is a volatile store.
// the newly created array elements can be safely published.
BIG_TEN_POWERS_TABLE = pows;
}
return pows[n];
--- 4050,4060 ----
pows = Arrays.copyOf(pows, newLen);
for (int i = curLen; i < newLen; i++) {
pows[i] = pows[i - 1].multiply(BigInteger.TEN);
}
// Based on the following facts:
! // 1. pows is a private local variable;
// 2. the following store is a volatile store.
// the newly created array elements can be safely published.
BIG_TEN_POWERS_TABLE = pows;
}
return pows[n];
< prev index next >