Class Remainder
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.BinaryFunction
com.singularsys.jep.misc.functions.Remainder
- All Implemented Interfaces:
PostfixMathCommandI
,RealBinaryFunction
,Serializable
Calculates the remainder and quotient the arguments.
Three different algorithms can be used
- TRUNCATED: q = (int) (x/y), r = x - q y . Remainder has same sign as divisor.
- FLOOR: q = floor(x/y), r = x - q y. Remainder has same sign as dividend.
- EUCLIDEAN: y>0, q = floor(x/y), y<0, ceil(x/y), r = x - q y. Remainder is non negative.
- Author:
- Richard Morris
- See Also:
-
Nested Class Summary
-
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.BinaryFunction
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
-
Remainder
- Parameters:
type
- type of remainder operation to perform
-
-
Method Details
-
eval
- Specified by:
eval
in classBinaryFunction
- Throws:
EvaluationException
-
evaluate
public double evaluate(double D, double d) - Specified by:
evaluate
in interfaceRealBinaryFunction
-