@Status(stage=PRODUCTION, unitTests=COMPLETE) @Review(by="Kees Schotanus", at="2009-09-28") @ThreadSafety(level=IMMUTABLE) public class CBigDecimal extends BigDecimal
BigDecimal
.Modifier and Type | Field and Description |
---|---|
static CBigDecimal |
HALF
The constant value 0.5.
|
static CBigDecimal |
TWO
The constant value 2.
|
ONE, ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_UNNECESSARY, ROUND_UP, TEN, ZERO
Constructor and Description |
---|
CBigDecimal(BigInteger value)
Creates this CBigDecimal from the supplied value.
|
CBigDecimal(BigInteger unscaledValue,
int scale)
Creates this CBigDecimal from the supplied unscaledValue and scale.
|
CBigDecimal(double value)
Creates this CBigDecimal from the supplied value.
|
CBigDecimal(int value)
Creates this CBigDecimal from the supplied value.
|
CBigDecimal(long value)
Creates this CBigDecimal from the supplied value.
|
CBigDecimal(String value)
Creates this CBigDecimal from the supplied value.
|
Modifier and Type | Method and Description |
---|---|
static BigDecimal |
squareRoot(BigDecimal value,
int precision)
Computes the square root of the supplied value.
|
BigDecimal |
squareRoot(int precision)
Computes the square root of this big decimal.
|
abs, abs, add, add, byteValueExact, compareTo, divide, divide, divide, divide, divide, divide, divideAndRemainder, divideAndRemainder, divideToIntegralValue, divideToIntegralValue, doubleValue, equals, floatValue, hashCode, intValue, intValueExact, longValue, longValueExact, max, min, movePointLeft, movePointRight, multiply, multiply, negate, negate, plus, plus, pow, pow, precision, remainder, remainder, round, scale, scaleByPowerOfTen, setScale, setScale, setScale, shortValueExact, signum, stripTrailingZeros, subtract, subtract, toBigInteger, toBigIntegerExact, toEngineeringString, toPlainString, toString, ulp, unscaledValue, valueOf, valueOf, valueOf
byteValue, shortValue
public static final CBigDecimal TWO
public static final CBigDecimal HALF
public CBigDecimal(BigInteger unscaledValue, int scale)
unscaledValue
- The unscaled value.scale
- The scale.public CBigDecimal(BigInteger value)
value
- The value to create this CBigDecimal from.public CBigDecimal(double value)
value
- The value to create this CBigDecimal from.public CBigDecimal(int value)
value
- The value to create this CBigDecimal from.public CBigDecimal(long value)
value
- The value to create this CBigDecimal from.public CBigDecimal(String value)
value
- The value to create this CBigDecimal from.public BigDecimal squareRoot(int precision)
squareRoot(BigDecimal, int)
for details.precision
- The number of decimals to which the square root needs to
be correct.
ArithmeticException
- When this decimal is negative.public static BigDecimal squareRoot(BigDecimal value, int precision)
value
- The value to calculate the square root of.precision
- The number of decimals to which the square root needs to
be correct.
ArithmeticException
- When the supplied value is negative.Copyright © 2008–2018. All rights reserved.