public class BigDecimalMath
extends java.lang.Object
BigDecimals.| Modifier and Type | Method and Description |
|---|---|
static java.math.BigDecimal |
acos(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc cosine (inverted cosine) of
BigDecimal x. |
static java.math.BigDecimal |
acosh(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc hyperbolic cosine (inverse hyperbolic cosine) of
BigDecimal x. |
static java.math.BigDecimal |
acot(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the inverse cotangens (arc cotangens) of
BigDecimal x. |
static java.math.BigDecimal |
acoth(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc hyperbolic cotangens (inverse hyperbolic cotangens) of
BigDecimal x. |
static java.math.BigDecimal |
asin(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc sine (inverted sine) of
BigDecimal x. |
static java.math.BigDecimal |
asinh(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc hyperbolic sine (inverse hyperbolic sine) of
BigDecimal x. |
static java.math.BigDecimal |
atan(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc tangens (inverted tangens) of
BigDecimal x. |
static java.math.BigDecimal |
atan2(java.math.BigDecimal y,
java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc tangens (inverted tangens) of
BigDecimal y / x in the range -pi to pi. |
static java.math.BigDecimal |
atanh(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the arc hyperbolic tangens (inverse hyperbolic tangens) of
BigDecimal x. |
static java.math.BigDecimal |
bernoulli(int n,
java.math.MathContext mathContext)
Calculates the Bernoulli number for the specified index.
|
static java.math.BigDecimal |
cos(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the cosine (cosinus) of
BigDecimal x. |
static java.math.BigDecimal |
cosh(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the hyperbolic cosine of
BigDecimal x. |
static java.math.BigDecimal |
cot(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the cotangens of
BigDecimal x. |
static java.math.BigDecimal |
coth(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the hyperbolic cotangens of
BigDecimal x. |
static java.math.BigDecimal |
e(java.math.MathContext mathContext)
Returns the number e.
|
static java.math.BigDecimal |
exp(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the natural exponent of
BigDecimal x (ex). |
static int |
exponent(java.math.BigDecimal value)
Returns the exponent of the specified
BigDecimal written as mantissa * 10exponent. |
static java.math.BigDecimal |
factorial(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the factorial of the specified
BigDecimal. |
static java.math.BigDecimal |
factorial(int n)
Calculates the factorial of the specified integer argument.
|
static java.math.BigDecimal |
fractionalPart(java.math.BigDecimal value)
Returns the fractional part of the specified
BigDecimal (right of the decimal point). |
static java.math.BigDecimal |
gamma(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the gamma function of the specified
BigDecimal. |
static java.math.BigDecimal |
integralPart(java.math.BigDecimal value)
Returns the integral part of the specified
BigDecimal (left of the decimal point). |
static boolean |
isDoubleValue(java.math.BigDecimal value)
Returns whether the specified
BigDecimal value can be represented as double. |
static boolean |
isIntValue(java.math.BigDecimal value)
Returns whether the specified
BigDecimal value can be represented as int. |
static boolean |
isLongValue(java.math.BigDecimal value)
Returns whether the specified
BigDecimal value can be represented as long. |
static java.math.BigDecimal |
log(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the natural logarithm of
BigDecimal x. |
static java.math.BigDecimal |
log10(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the logarithm of
BigDecimal x to the base 10. |
static java.math.BigDecimal |
log2(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the logarithm of
BigDecimal x to the base 2. |
static java.math.BigDecimal |
mantissa(java.math.BigDecimal value)
Returns the mantissa of the specified
BigDecimal written as mantissa * 10exponent. |
static java.math.BigDecimal |
pi(java.math.MathContext mathContext)
Returns the number pi.
|
static java.math.BigDecimal |
pow(java.math.BigDecimal x,
java.math.BigDecimal y,
java.math.MathContext mathContext)
Calculates
BigDecimal x to the power of BigDecimal y (xy). |
static java.math.BigDecimal |
pow(java.math.BigDecimal x,
long y,
java.math.MathContext mathContext)
Calculates
BigDecimal x to the power of long y (xy). |
static java.math.BigDecimal |
reciprocal(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the reciprocal of the specified
BigDecimal. |
static java.math.BigDecimal |
root(java.math.BigDecimal x,
java.math.BigDecimal n,
java.math.MathContext mathContext)
Calculates the n'th root of
BigDecimal x. |
static java.math.BigDecimal |
round(java.math.BigDecimal value,
java.math.MathContext mathContext)
Rounds the specified
BigDecimal to the precision of the specified MathContext. |
static java.math.BigDecimal |
roundWithTrailingZeroes(java.math.BigDecimal value,
java.math.MathContext mathContext)
Rounds the specified
BigDecimal to the precision of the specified MathContext including trailing zeroes. |
static int |
significantDigits(java.math.BigDecimal value)
Returns the number of significant digits of the specified
BigDecimal. |
static java.math.BigDecimal |
sin(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the sine (sinus) of
BigDecimal x. |
static java.math.BigDecimal |
sinh(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the hyperbolic sine of
BigDecimal x. |
static java.math.BigDecimal |
sqrt(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the square root of
BigDecimal x. |
static java.math.BigDecimal |
tan(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the tangens of
BigDecimal x. |
static java.math.BigDecimal |
tanh(java.math.BigDecimal x,
java.math.MathContext mathContext)
Calculates the hyperbolic tangens of
BigDecimal x. |
static java.math.BigDecimal |
toBigDecimal(java.lang.String string)
Creates a
BigDecimal from the specified String representation. |
static java.math.BigDecimal |
toBigDecimal(java.lang.String string,
java.math.MathContext mathContext)
Creates a
BigDecimal from the specified String representation. |
public static java.math.BigDecimal toBigDecimal(java.lang.String string)
BigDecimal from the specified String representation.
This method is equivalent to the String constructor BigDecimal.BigDecimal(String)
but has been optimized for large strings (several thousand digits).
string - the String representationBigDecimaljava.lang.NumberFormatException - if string is not a valid representation of a BigDecimalBigDecimal.BigDecimal(String),
toBigDecimal(String, MathContext)public static java.math.BigDecimal toBigDecimal(java.lang.String string,
java.math.MathContext mathContext)
BigDecimal from the specified String representation.
This method is equivalent to the String constructor BigDecimal.BigDecimal(String, MathContext)
but has been optimized for large strings (several thousand digits).
string - the string representationmathContext - the MathContext used for the resultBigDecimaljava.lang.NumberFormatException - if string is not a valid representation of a BigDecimaljava.lang.ArithmeticException - if the result is inexact but the rounding mode is UNNECESSARYBigDecimal.BigDecimal(String, MathContext),
toBigDecimal(String)public static boolean isIntValue(java.math.BigDecimal value)
BigDecimal value can be represented as int.
If this returns true you can call BigDecimal.intValueExact() without fear of an ArithmeticException.
value - the BigDecimal to checktrue if the value can be represented as int valuepublic static boolean isLongValue(java.math.BigDecimal value)
BigDecimal value can be represented as long.
If this returns true you can call BigDecimal.longValueExact() without fear of an ArithmeticException.
value - the BigDecimal to checktrue if the value can be represented as long valuepublic static boolean isDoubleValue(java.math.BigDecimal value)
BigDecimal value can be represented as double.
If this returns true you can call BigDecimal.doubleValue()
without fear of getting Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY as result.
Example: BigDecimalMath.isDoubleValue(new BigDecimal("1E309")) returns false,
because new BigDecimal("1E309").doubleValue() returns Infinity.
Note: This method does not check for possible loss of precision.
For example BigDecimalMath.isDoubleValue(new BigDecimal("1.23400000000000000000000000000000001")) will return true,
because new BigDecimal("1.23400000000000000000000000000000001").doubleValue() returns a valid double value,
although it loses precision and returns 1.234.
BigDecimalMath.isDoubleValue(new BigDecimal("1E-325")) will return true
although this value is smaller than Double.MIN_VALUE (and therefore outside the range of values that can be represented as double)
because new BigDecimal("1E-325").doubleValue() returns 0 which is a legal value with loss of precision.
value - the BigDecimal to checktrue if the value can be represented as double valuepublic static java.math.BigDecimal mantissa(java.math.BigDecimal value)
BigDecimal written as mantissa * 10exponent.
The mantissa is defined as having exactly 1 digit before the decimal point.
value - the BigDecimalexponent(BigDecimal)public static int exponent(java.math.BigDecimal value)
BigDecimal written as mantissa * 10exponent.
The mantissa is defined as having exactly 1 digit before the decimal point.
value - the BigDecimalmantissa(BigDecimal)public static int significantDigits(java.math.BigDecimal value)
BigDecimal.
The result contains the number of all digits before the decimal point and all digits after the decimal point excluding trailing zeroes.
Examples:
significantDigits(new BigDecimal("12300.00")) returns 5significantDigits(new BigDecimal("1.23000")) returns 3significantDigits(new BigDecimal("0.00012300")) returns 3significantDigits(new BigDecimal("12300.4500")) returns 7value - the BigDecimalBigDecimal.stripTrailingZeros(),
BigDecimal.precision()public static java.math.BigDecimal integralPart(java.math.BigDecimal value)
BigDecimal (left of the decimal point).value - the BigDecimalfractionalPart(BigDecimal)public static java.math.BigDecimal fractionalPart(java.math.BigDecimal value)
BigDecimal (right of the decimal point).value - the BigDecimalintegralPart(BigDecimal)public static java.math.BigDecimal round(java.math.BigDecimal value,
java.math.MathContext mathContext)
BigDecimal to the precision of the specified MathContext.
This method calls BigDecimal.round(MathContext).
value - the BigDecimal to roundmathContext - the MathContext used for the resultBigDecimal valueBigDecimal.round(MathContext),
roundWithTrailingZeroes(BigDecimal, MathContext)public static java.math.BigDecimal roundWithTrailingZeroes(java.math.BigDecimal value,
java.math.MathContext mathContext)
BigDecimal to the precision of the specified MathContext including trailing zeroes.
This method is similar to BigDecimal.round(MathContext) but does not remove the trailing zeroes.
Example:
MathContext mc = new MathContext(5);
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("1.234567"), mc)); // 1.2346
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("123.4567"), mc)); // 123.46
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("0.001234567"), mc)); // 0.0012346
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("1.23"), mc)); // 1.2300
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("1.230000"), mc)); // 1.2300
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("0.00123"), mc)); // 0.0012300
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("0"), mc)); // 0.0000
System.out.println(BigDecimalMath.roundWithTrailingZeroes(new BigDecimal("0.00000000"), mc)); // 0.0000
value - the BigDecimal to roundmathContext - the MathContext used for the resultBigDecimal value including trailing zeroesBigDecimal.round(MathContext),
round(BigDecimal, MathContext)public static java.math.BigDecimal reciprocal(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal.x - the BigDecimalmathContext - the MathContext used for the resultBigDecimaljava.lang.ArithmeticException - if x = 0java.lang.ArithmeticException - if the result is inexact but the
rounding mode is UNNECESSARY or
mc.precision == 0 and the quotient has a
non-terminating decimal expansion.public static java.math.BigDecimal factorial(int n)
factorial = 1 * 2 * 3 * ... n
n - the BigDecimalBigDecimaljava.lang.ArithmeticException - if x < 0public static java.math.BigDecimal factorial(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal.
This implementation uses Spouge's approximation to calculate the factorial for non-integer values.
This involves calculating a series of constants that depend on the desired precision. Since this constant calculation is quite expensive (especially for higher precisions), the constants for a specific precision will be cached and subsequent calls to this method with the same precision will be much faster.
It is therefore recommended to do one call to this method with the standard precision of your application during the startup phase and to avoid calling it with many different precisions.
See: Wikipedia: Factorial - Extension of factorial to non-integer values of argument
x - the BigDecimalmathContext - the MathContext used for the resultBigDecimaljava.lang.ArithmeticException - if x is a negative integer value (-1, -2, -3, ...)java.lang.UnsupportedOperationException - if x is a non-integer value and the MathContext has unlimited precisionfactorial(int),
gamma(BigDecimal, MathContext)public static java.math.BigDecimal gamma(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal.
This implementation uses factorial(BigDecimal, MathContext) internally,
therefore the performance implications described there apply also for this method.
x - the BigDecimalmathContext - the MathContext used for the resultBigDecimaljava.lang.ArithmeticException - if x-1 is a negative integer value (-1, -2, -3, ...)java.lang.UnsupportedOperationException - if x is a non-integer value and the MathContext has unlimited precisionfactorial(BigDecimal, MathContext)public static java.math.BigDecimal bernoulli(int n,
java.math.MathContext mathContext)
This function calculates the first Bernoulli numbers and therefore bernoulli(1) returns -0.5
Note that bernoulli(x) for all odd x > 1 returns 0
n - the index of the Bernoulli number to be calculated (starting at 0)mathContext - the MathContext used for the resultjava.lang.ArithmeticException - if x < 0java.lang.ArithmeticException - if the result is inexact but the
rounding mode is UNNECESSARY or
mc.precision == 0 and the quotient has a
non-terminating decimal expansion.public static java.math.BigDecimal pow(java.math.BigDecimal x,
java.math.BigDecimal y,
java.math.MathContext mathContext)
BigDecimal x to the power of BigDecimal y (xy).x - the BigDecimal value to take to the powery - the BigDecimal value to serve as exponentmathContext - the MathContext used for the resultmathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpow(BigDecimal, long, MathContext)public static java.math.BigDecimal pow(java.math.BigDecimal x,
long y,
java.math.MathContext mathContext)
BigDecimal x to the power of long y (xy).
The implementation tries to minimize the number of multiplications of x (using squares whenever possible).
x - the BigDecimal value to take to the powery - the long value to serve as exponentmathContext - the MathContext used for the resultmathContextjava.lang.ArithmeticException - if y is negative and the result is inexact but the
rounding mode is UNNECESSARY or
mc.precision == 0 and the quotient has a
non-terminating decimal expansion.java.lang.ArithmeticException - if the rounding mode is
UNNECESSARY and the
BigDecimal operation would require rounding.public static java.math.BigDecimal sqrt(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal value to calculate the square rootmathContext - the MathContext used for the resultmathContextjava.lang.ArithmeticException - if x < 0java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal root(java.math.BigDecimal x,
java.math.BigDecimal n,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal value to calculate the n'th rootn - the BigDecimal defining the rootmathContext - the MathContext used for the resultmathContextjava.lang.ArithmeticException - if x < 0java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal log(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the natural logarithm formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.ArithmeticException - if x <= 0java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal log2(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x to the base 2.x - the BigDecimal to calculate the logarithm base 2 formathContext - the MathContext used for the resultBigDecimal to the base 2 with the precision specified in the mathContextjava.lang.ArithmeticException - if x <= 0java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal log10(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x to the base 10.x - the BigDecimal to calculate the logarithm base 10 formathContext - the MathContext used for the resultBigDecimal to the base 10 with the precision specified in the mathContextjava.lang.ArithmeticException - if x <= 0java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal pi(java.math.MathContext mathContext)
See Wikipedia: Pi
mathContext - the MathContext used for the resultmathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal e(java.math.MathContext mathContext)
mathContext - the MathContext used for the resultmathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal exp(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x (ex).
See: Wikipedia: Exponent
x - the BigDecimal to calculate the exponent formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal sin(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
See: Wikipedia: Sine
x - the BigDecimal to calculate the sine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal asin(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
See: Wikipedia: Arcsine
x - the BigDecimal to calculate the arc sine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.ArithmeticException - if x > 1 or x < -1java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal cos(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
See: Wikipedia: Cosine
x - the BigDecimal to calculate the cosine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal acos(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
See: Wikipedia: Arccosine
x - the BigDecimal to calculate the arc cosine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.ArithmeticException - if x > 1 or x < -1java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal tan(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
See: Wikipedia: Tangens
x - the BigDecimal to calculate the tangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal atan(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the arc tangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal atan2(java.math.BigDecimal y,
java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal y / x in the range -pi to pi.
This is useful to calculate the angle theta from the conversion of rectangular
coordinates (x, y) to polar coordinates (r, theta).
See: Wikipedia: Atan2
y - the BigDecimalx - the BigDecimalmathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.ArithmeticException - if x = 0 and y = 0java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal cot(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
See: Wikipedia: Cotangens
x - the BigDecimal to calculate the cotangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.ArithmeticException - if x = 0java.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal acot(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the arc cotangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal sinh(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the hyperbolic sine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal cosh(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the hyperbolic cosine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal tanh(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the hyperbolic tangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal coth(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the hyperbolic cotangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal asinh(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the arc hyperbolic sine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal acosh(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the arc hyperbolic cosine formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal atanh(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the arc hyperbolic tangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precisionpublic static java.math.BigDecimal acoth(java.math.BigDecimal x,
java.math.MathContext mathContext)
BigDecimal x.
x - the BigDecimal to calculate the arc hyperbolic cotangens formathContext - the MathContext used for the resultBigDecimal with the precision specified in the mathContextjava.lang.UnsupportedOperationException - if the MathContext has unlimited precision