Package tech.units.indriya.function
Class Calculus
- java.lang.Object
-
- tech.units.indriya.function.Calculus
-
public final class Calculus extends java.lang.Object
Mathematical helper class
-
-
Field Summary
Fields Modifier and Type Field Description static java.math.MathContext
DEFAULT_MATH_CONTEXT
The default MathContext used for BigDecimal calculus.private static java.util.logging.Logger
logger
static java.math.MathContext
MATH_CONTEXT
Exposes (non-final) the MathContext used for BigDecimal calculus.private static java.lang.String
MSG_NUMBER_NON_NULL
-
Constructor Summary
Constructors Constructor Description Calculus()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Number
abs(java.lang.Number number)
Returns the absolute value ofnumber
static boolean
isLessThanOne(java.lang.Number number)
static java.lang.Number
negate(java.lang.Number number)
Returns the negated value ofnumber
static java.math.BigDecimal
toBigDecimal(java.lang.Number number)
Converts a number toBigDecimal
static java.math.BigInteger
toBigInteger(java.lang.Number number)
Converts a number toBigInteger
-
-
-
Field Detail
-
MSG_NUMBER_NON_NULL
private static final java.lang.String MSG_NUMBER_NON_NULL
- See Also:
- Constant Field Values
-
logger
private static final java.util.logging.Logger logger
-
DEFAULT_MATH_CONTEXT
public static final java.math.MathContext DEFAULT_MATH_CONTEXT
The default MathContext used for BigDecimal calculus.
-
MATH_CONTEXT
public static java.math.MathContext MATH_CONTEXT
Exposes (non-final) the MathContext used for BigDecimal calculus.
-
-
Method Detail
-
toBigDecimal
public static java.math.BigDecimal toBigDecimal(java.lang.Number number)
Converts a number toBigDecimal
- Parameters:
number
- the number to be converted- Returns:
- the number converted
-
toBigInteger
public static java.math.BigInteger toBigInteger(java.lang.Number number)
Converts a number toBigInteger
- Parameters:
number
- the number to be converted- Returns:
- the number converted
-
abs
public static java.lang.Number abs(java.lang.Number number)
Returns the absolute value ofnumber
- Parameters:
number
-- Returns:
-
negate
public static java.lang.Number negate(java.lang.Number number)
Returns the negated value ofnumber
- Parameters:
number
-- Returns:
- -number
-
isLessThanOne
public static boolean isLessThanOne(java.lang.Number number)
- Parameters:
number
-- Returns:
-
-