Package com.singularsys.jep.functions
Class Add
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryBinaryFunction
com.singularsys.jep.functions.Add
- All Implemented Interfaces:
PostfixMathCommandI
,RealBinaryFunction
,Serializable
- Direct Known Subclasses:
BigDecAdd
Addition function. Supports any number of parameters although typically
only 2 parameters are used.
- Author:
- nathan
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, name, NaN, numberOfParameters
-
Constructor Summary
-
Method Summary
Methods inherited from class com.singularsys.jep.functions.NaryBinaryFunction
checkNumberOfParameters, eval, instanceOf, instanceOf, run
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
-
Constructor Details
-
Add
public Add()
-
-
Method Details
-
eval
- Specified by:
eval
in classNaryBinaryFunction
- Throws:
EvaluationException
-
add
Adds two numbers together. The parameters can be of type Number, Complex, or String. If a certain combination of types is not supported, a EvaluationException is thrown.- Parameters:
param1
- The first parameter to be added.param2
- The second parameter to be added.- Returns:
- The sum of param1 and param2, or concatenation of the two if they are Strings.
- Throws:
EvaluationException
- if the calculation cannot be performed
-
add
-
add
-
add
- Throws:
EvaluationException
-
add
-
evaluate
public double evaluate(double l, double r) - Specified by:
evaluate
in interfaceRealBinaryFunction
-