Class BigDecMul
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryBinaryFunction
com.singularsys.jep.functions.Multiply
com.singularsys.jep.bigdecimal.functions.BigDecMul
- All Implemented Interfaces:
FixedPrecisionFunctionI,PostfixMathCommandI,RealBinaryFunction,Serializable
Multiplication function for BigDecimals, Double and other Number types.
Uses
BigDecimal.multiply(BigDecimal,MathContext).
Since Jep 4.1 can work with vectors.
- See Also:
-
Field Summary
FieldsFields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEvaluate given an array of arguments.intGets the number of decimal places used.voidvoidsetDecimalPlaces(int scale) Sets the number of decimal places to use.voidMethods inherited from class com.singularsys.jep.functions.Multiply
eval, evaluate, mul, mul, mul, mul, mulMethods inherited from class com.singularsys.jep.functions.NaryBinaryFunction
checkNumberOfParameters, instanceOf, instanceOf, instanceOf, instanceOfMethods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Field Details
-
mc
-
scale
protected int scale
-
-
Constructor Details
-
BigDecMul
- Parameters:
mc-
-
BigDecMul
-
-
Method Details
-
mul
- Overrides:
mulin classMultiply- Throws:
EvaluationException
-
eval
Description copied from class:NaryBinaryFunctionEvaluate given an array of arguments. Calls theNaryBinaryFunction.eval(Object, Object)method for the first pair of arguments, then repeatedly with the current result and the next argument.- Overrides:
evalin classNaryBinaryFunction- Parameters:
args- array of arguments to function, must have at least one element- Returns:
- result of function
- Throws:
EvaluationException- if empty array
-
run
Description copied from class:NaryBinaryFunction- Specified by:
runin interfacePostfixMathCommandI- Overrides:
runin classNaryBinaryFunction- Parameters:
stack- arguments for function- Throws:
EvaluationException- if function cannot be evaluated
-
getMathContext
-
setMathContext
-
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
-
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
-