Modifier and Type | Method and Description |
---|---|
static long |
abs(DecimalArithmetic arith,
long value)
Returns the absolute value
|value| throwing an exception if an
overflow occurs. |
static long |
add(DecimalArithmetic arith,
long uDecimal1,
long uDecimal2)
Returns the sum
(uDecimal1 + uDecimal2) of the two unsigned
decimal values throwing an exception if an overflow occurs. |
static long |
addLong(long long1,
long long2)
Returns the sum
(long1 + long2) of the two long values
throwing an exception if an overflow occurs. |
static long |
divideByLong(DecimalArithmetic arith,
long uDecimalDividend,
long lDivisor)
Returns the quotient
(uDecimalDividend / lDivisor) of an unscaled
decimal value and a long value throwing an exception if an
overflow occurs. |
static long |
divideLong(long lDividend,
long lDivisor)
Returns the quotient
(lDividend / lDivisor) of the two
long values throwing an exception if an overflow occurs. |
(package private) static boolean |
isAddOverflow(long long1,
long long2,
long result)
Returns true if the addition
long1 + long2 = result has resulted
in an overflow. |
(package private) static boolean |
isDivideOverflow(long dividend,
long divisor)
Returns true if the quotient
dividend / divisor will result in an
overflow. |
(package private) static boolean |
isSubtractOverflow(long minuend,
long subtrahend,
long result)
Returns true if the subtraction
minuend - subtrahend = result has
resulted in an overflow. |
static long |
multiplyByLong(DecimalArithmetic arith,
long uDecimal,
long lValue)
Returns the product
(uDecimal * lValue) of an unsigned decimal
value and a long value throwing an exception if an overflow
occurs. |
static long |
multiplyLong(long lValue1,
long lValue2)
Returns the product
(lValue1 * lValue2) of the two long
values throwing an exception if an overflow occurs. |
static long |
negate(DecimalArithmetic arith,
long value)
Returns the negation
(-value) throwing an exception if an
overflow occurs. |
static long |
subtract(DecimalArithmetic arith,
long uDecimalMinuend,
long uDecimalSubtrahend)
Returns the difference
(uDecimalMinuend - uDecimalSubtrahend) of
the two unscaled decimal values throwing an exception if an overflow
occurs. |
static long |
subtractLong(long lMinuend,
long lSubtrahend)
Returns the difference
(lMinuend - lSubtrahend) of the two
long values throwing an exception if an overflow occurs. |
static final boolean isAddOverflow(long long1, long long2, long result)
long1 + long2 = result
has resulted
in an overflow.long1
- the first summandlong2
- the second summandresult
- the sumstatic final boolean isSubtractOverflow(long minuend, long subtrahend, long result)
minuend - subtrahend = result
has
resulted in an overflow.minuend
- the minuend to subtract fromsubtrahend
- the subtrahend to subtractresult
- the differencestatic final boolean isDivideOverflow(long dividend, long divisor)
dividend / divisor
will result in an
overflow.dividend
- the dividenddivisor
- the divisorpublic static final long addLong(long long1, long long2)
(long1 + long2)
of the two long
values
throwing an exception if an overflow occurs.long1
- the first summandlong2
- the second summandArithmeticException
- if the calculation results in an overflowpublic static final long add(DecimalArithmetic arith, long uDecimal1, long uDecimal2)
(uDecimal1 + uDecimal2)
of the two unsigned
decimal values throwing an exception if an overflow occurs.arith
- the arithmetic associated with the two unsigned decimalsuDecimal1
- the first summanduDecimal2
- the second summandArithmeticException
- if the calculation results in an overflowpublic static final long subtractLong(long lMinuend, long lSubtrahend)
(lMinuend - lSubtrahend)
of the two
long
values throwing an exception if an overflow occurs.lMinuend
- the minuendlSubtrahend
- the subtrahendArithmeticException
- if the calculation results in an overflowpublic static final long subtract(DecimalArithmetic arith, long uDecimalMinuend, long uDecimalSubtrahend)
(uDecimalMinuend - uDecimalSubtrahend)
of
the two unscaled decimal values throwing an exception if an overflow
occurs.arith
- the arithmetic associated with the two unsigned decimalsuDecimalMinuend
- the minuenduDecimalSubtrahend
- the subtrahendArithmeticException
- if the calculation results in an overflowpublic static final long multiplyLong(long lValue1, long lValue2)
(lValue1 * lValue2)
of the two long
values throwing an exception if an overflow occurs.lValue1
- the first factorlValue2
- the second factorArithmeticException
- if the calculation results in an overflowpublic static final long multiplyByLong(DecimalArithmetic arith, long uDecimal, long lValue)
(uDecimal * lValue)
of an unsigned decimal
value and a long
value throwing an exception if an overflow
occurs.arith
- the arithmetic associated with the first unsigned decimal
argumentuDecimal
- the first factorlValue
- the second factorArithmeticException
- if the calculation results in an overflowpublic static final long divideLong(long lDividend, long lDivisor)
(lDividend / lDivisor)
of the two
long
values throwing an exception if an overflow occurs.lDividend
- the dividend to dividelDivisor
- the divisor to divide byArithmeticException
- if the calculation results in an overflowpublic static final long divideByLong(DecimalArithmetic arith, long uDecimalDividend, long lDivisor)
(uDecimalDividend / lDivisor)
of an unscaled
decimal value and a long
value throwing an exception if an
overflow occurs.arith
- the arithmetic associated with the first unsigned decimal
argumentuDecimalDividend
- the dividend to dividelDivisor
- the divisor to divide byArithmeticException
- if the calculation results in an overflowpublic static final long abs(DecimalArithmetic arith, long value)
|value|
throwing an exception if an
overflow occurs.arith
- the arithmetic associated with the valuevalue
- the number whose absolute value to returnArithmeticException
- if the calculation results in an overflowpublic static final long negate(DecimalArithmetic arith, long value)
(-value)
throwing an exception if an
overflow occurs.arith
- the arithmetic associated with the valuevalue
- the number to negateArithmeticException
- if the calculation results in an overflow