Class BigDecAbs
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.UnaryFunction
com.singularsys.jep.functions.Abs
com.singularsys.jep.bigdecimal.functions.BigDecAbs
- All Implemented Interfaces:
FixedPrecisionFunctionI,PostfixMathCommandI,RealUnaryFunction,Serializable
Absolute value function for BigDecimals, Double and other Number types.
Uses
BigDecimal.abs() for BigDecimals and Abs for other types.- Author:
- Richard Morris
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.singularsys.jep.functions.UnaryFunction
UnaryFunction.FunctionWithException<T> -
Field Summary
FieldsFields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalculates the absolute value of its argumentintGets the number of decimal places used.voidsetDecimalPlaces(int scale) Sets the number of decimal places to use.voidMethods inherited from class com.singularsys.jep.functions.UnaryFunction
instanceOf, instanceOf, instanceOf, instanceOf, runMethods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, checkNumberOfParameters, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Field Details
-
scale
protected int scale -
mc
-
-
Constructor Details
-
BigDecAbs
-
BigDecAbs
-
-
Method Details
-
abs
Description copied from class:AbsCalculates the absolute value of its argument- Overrides:
absin classAbs- Parameters:
l- supports Double, Float, Integer, Long, Short, Complex and Number arguments- Returns:
- the absolute value. Gives the same type as its argument except for Number arguments that are converted to Double before conversions and return a Double argument.
- Throws:
EvaluationException- if type not supported
-
setMathContext
-
getDecimalPlaces
public int getDecimalPlaces()Description copied from interface:FixedPrecisionFunctionIGets the number of decimal places used.- Specified by:
getDecimalPlacesin interfaceFixedPrecisionFunctionI- Returns:
- either zero, a positive number or -1 for floating-point formats
-
setDecimalPlaces
public void setDecimalPlaces(int scale) Description copied from interface:FixedPrecisionFunctionISets the number of decimal places to use.- Specified by:
setDecimalPlacesin interfaceFixedPrecisionFunctionI- Parameters:
scale- either zero, a positive number or -1 for floating-point formats
-
getMathContext
-