public final class BigDecimalFunctions extends Object
| Modifier and Type | Field and Description |
|---|---|
static BigDecimal |
PI |
| Constructor and Description |
|---|
BigDecimalFunctions() |
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
arccos(BigDecimal value,
MathContext mc)
Calculates the
arccosine of the given value. |
static BigDecimal |
arcsin(BigDecimal value,
MathContext mc)
Calculates the
arcsine of the given value. |
static BigDecimal |
arctan(BigDecimal value,
MathContext mc)
Calculates the
arctangent of the given value. |
static BigDecimal |
cos(BigDecimal angle,
MathContext mc)
Calculates the
cosine of an angle in radians. |
static BigDecimal |
exp(BigDecimal exponent,
MathContext mc)
Calculates
eexponent. |
static BigDecimal |
factorial(BigDecimal value,
MathContext mc)
Calculates the
factorial of a value. |
static BigDecimal |
getFraction(BigDecimal number)
Returns the fractional part of
number. |
static BigDecimal |
getWhole(BigDecimal number)
Returns the whole part of
number. |
static BigDecimal |
ln(BigDecimal value,
MathContext mc)
Calculates
loge value. |
static BigDecimal |
pow(BigDecimal base,
BigDecimal exponent,
MathContext mc)
Calculates
baseexponent. |
static BigDecimal |
pow(BigDecimal base,
long exponent,
MathContext mc)
Calculates
baseexponent. |
static BigDecimal |
root(BigDecimal base,
long exponent,
MathContext mc)
Calculates the
exponentth root of
base. |
static BigDecimal |
sin(BigDecimal angle,
MathContext mc)
Calculates the
sine of an angle in radians. |
static BigDecimal |
sqrt(BigDecimal value,
MathContext mc)
Calculates the square root of
value. |
static BigDecimal |
tan(BigDecimal angle,
MathContext mc)
Calculates the
tangent of an angle in radians. |
public static final BigDecimal PI
public static BigDecimal exp(BigDecimal exponent, MathContext mc)
eexponent. The result is rounded
according to the passed context mc.exponent - the value to which e is raised.mc - rounding mode and precision for the result of this operation.eexponentpublic static BigDecimal pow(BigDecimal base, long exponent, MathContext mc)
baseexponent. The result is rounded
according to the passed context mc. This function
specifically works on a long exponent.base - the value which is raised.exponent - the value to which the base is raised.mc - rounding mode and precision for the result of this operation.baseexponentpublic static BigDecimal getWhole(BigDecimal number)
number.number - the number whose whole part is calculated.numberpublic static BigDecimal getFraction(BigDecimal number)
number.number - the number whose fractional part is calculated.numberpublic static BigDecimal ln(BigDecimal value, MathContext mc)
loge value. The result is rounded
according to the passed context mc.value - calculates log of this value.mc - rounding mode and precision for the result of this operation.loge valueIllegalArgumentException - if value <= 0.public static BigDecimal pow(BigDecimal base, BigDecimal exponent, MathContext mc)
baseexponent. The result is rounded
according to the passed context mc.base - the value which is raised.exponent - the value to which the base is raised.mc - rounding mode and precision for the result of this operation.baseexponentpublic static BigDecimal sqrt(BigDecimal value, MathContext mc)
value. The result is rounded
according to the passed context mc.value - the number to be rooted.mc - rounding mode and precision for the result of this operation.value(1/2)public static BigDecimal root(BigDecimal base, long exponent, MathContext mc)
exponentth root of
base. The result is rounded according to the passed context
mc.base - the number to be rooted.exponent - the order of rootingmc - rounding mode and precision for the result of this operation.base(1/exponent)public static BigDecimal sin(BigDecimal angle, MathContext mc)
sine of an angle in radians. The
result is rounded according to the passed context mc.angle - the angle in radians.mc - rounding mode and precision for the result of this operation.sin (angle)public static BigDecimal cos(BigDecimal angle, MathContext mc)
cosine of an angle in radians.
The result is rounded according to the passed context mc.angle - the angle in radians.mc - rounding mode and precision for the result of this operation.cos (angle)public static BigDecimal tan(BigDecimal angle, MathContext mc)
tangent of an angle in radians.
The result is rounded according to the passed context mc.angle - the angle in radians.mc - rounding mode and precision for the result of this operation.tan (angle)ArithmaticException - if angle = PI / 2 (or its odd multiple).public static BigDecimal factorial(BigDecimal value, MathContext mc)
factorial of a value. The result is rounded
according to the passed context mc.value - the number whose factorial is to be found.mc - rounding mode and precision for the result of this operation.value!public static BigDecimal arcsin(BigDecimal value, MathContext mc)
arcsine of the given value. The result is
rounded according to the passed context mc.value - the number whose arcsine is to be found.mc - rounding mode and precision for the result of this operation.sin-1(value)IllegalArgumentException - if value >= 1 and value <= -1.public static BigDecimal arccos(BigDecimal value, MathContext mc)
arccosine of the given value. The result is
rounded according to the passed context mc.value - the number whose arccosine is to be found.mc - rounding mode and precision for the result of this operation.cos-1(value)IllegalArgumentException - if value >= 1 and value <= -1.public static BigDecimal arctan(BigDecimal value, MathContext mc)
arctangent of the given value. The result is
rounded according to the passed context mc.value - the number whose arctangent is to be found.mc - rounding mode and precision for the result of this operation.tan-1(value)Copyright © 2016. All rights reserved.