| Package | Description |
|---|---|
| java.math |
Provides classes for performing arbitrary-precision integer arithmetic
(BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).
|
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
BigDecimal.abs()
Returns a BigDecimal whose value is the absolute value of this
BigDecimal, and whose scale is this.scale().
|
BigDecimal |
BigDecimal.add(BigDecimal val)
Returns a BigDecimal whose value is (this + val), and whose
scale is max(this.scale(), val.scale()).
|
BigDecimal |
BigDecimal.divide(BigDecimal val,
int roundingMode)
Returns a BigDecimal whose value is (this / val), and whose
scale is this.scale().
|
BigDecimal |
BigDecimal.divide(BigDecimal val,
int scale,
int roundingMode)
Returns a BigDecimal whose value is (this / val), and whose
scale is as specified.
|
BigDecimal |
BigDecimal.max(BigDecimal val)
Returns the maximum of this BigDecimal and val.
|
BigDecimal |
BigDecimal.min(BigDecimal val)
Returns the minimum of this BigDecimal and val.
|
BigDecimal |
BigDecimal.movePointLeft(int n)
Returns a BigDecimal which is equivalent to this one with the decimal
point moved n places to the left.
|
BigDecimal |
BigDecimal.movePointRight(int n)
Moves the decimal point the specified number of places to the right.
|
BigDecimal |
BigDecimal.multiply(BigDecimal val)
Returns a BigDecimal whose value is (this * val), and whose
scale is (this.scale() + val.scale()).
|
BigDecimal |
BigDecimal.negate()
Returns a BigDecimal whose value is (-this), and whose scale
is this.scale().
|
BigDecimal |
BigDecimal.setScale(int scale)
Returns a BigDecimal whose scale is the specified value, and whose
value is numerically equal to this BigDecimal's.
|
BigDecimal |
BigDecimal.setScale(int scale,
int roundingMode)
Returns a BigDecimal whose scale is the specified value, and whose
unscaled value is determined by multiplying or dividing this
BigDecimal's unscaled value by the appropriate power of ten to maintain
its overall value.
|
BigDecimal |
BigDecimal.subtract(BigDecimal val)
Returns a BigDecimal whose value is (this - val), and whose
scale is max(this.scale(), val.scale()).
|
static BigDecimal |
BigDecimal.valueOf(long val)
Translates a
long value into a BigDecimal with a
scale of zero. |
static BigDecimal |
BigDecimal.valueOf(long unscaledVal,
int scale)
Translates a
long unscaled value and an
int scale into a BigDecimal. |
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
BigDecimal.add(BigDecimal val)
Returns a BigDecimal whose value is (this + val), and whose
scale is max(this.scale(), val.scale()).
|
int |
BigDecimal.compareTo(BigDecimal val)
Compares this BigDecimal with the specified BigDecimal.
|
BigDecimal |
BigDecimal.divide(BigDecimal val,
int roundingMode)
Returns a BigDecimal whose value is (this / val), and whose
scale is this.scale().
|
BigDecimal |
BigDecimal.divide(BigDecimal val,
int scale,
int roundingMode)
Returns a BigDecimal whose value is (this / val), and whose
scale is as specified.
|
BigDecimal |
BigDecimal.max(BigDecimal val)
Returns the maximum of this BigDecimal and val.
|
BigDecimal |
BigDecimal.min(BigDecimal val)
Returns the minimum of this BigDecimal and val.
|
BigDecimal |
BigDecimal.multiply(BigDecimal val)
Returns a BigDecimal whose value is (this * val), and whose
scale is (this.scale() + val.scale()).
|
BigDecimal |
BigDecimal.subtract(BigDecimal val)
Returns a BigDecimal whose value is (this - val), and whose
scale is max(this.scale(), val.scale()).
|
Copyright © 2013 CableLabs. All rights reserved.