Class Factorial
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.UnaryFunction
com.singularsys.jep.misc.functions.Factorial
- All Implemented Interfaces:
PostfixMathCommandI
,Serializable
Simple implementation of factorial, good up to 20!
- 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.UnaryFunction
instanceOf, instanceOf, run
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
-
Constructor Details
-
Factorial
public Factorial()
-
-
Method Details
-
eval
Evaluates the factorial function- Specified by:
eval
in classUnaryFunction
- Parameters:
arg
- number to find factorial of- Returns:
- the factorial as a Long integer
- Throws:
EvaluationException
- if argument is greater than 20 causing overflow in result
-