Package com.singularsys.jep.functions

# Class Modulus

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.BinaryFunction
com.singularsys.jep.functions.Modulus

All Implemented Interfaces:
  `PostfixMathCommandI`, `RealBinaryFunction`, `Serializable`

Direct Known Subclasses:
  `BigDecMod`

public class Modulus extends BinaryFunction implements RealBinaryFunction
Calculates the modulus x % y of the arguments. Both arguments are converted to double and the result is a double. The sign of the result is the same as the sign of the argument.

Author:
  Richard Morris
See Also:
  - `Remainder`
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.singularsys.jep.functions.BinaryFunction

  `BinaryFunction.BiFunctionWithException<T>`

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand

  `curNumberOfParameters, description, name, NaN, numberOfParameters`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Modulus()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `eval(Object l, Object r)`
  Evaluate the function
  `double`
  `evaluate(double l, double r)`
  `Object`
  `mod(Object l, Object r)`

  ### Methods inherited from class com.singularsys.jep.functions.BinaryFunction

  `instanceOf, instanceOf, instanceOf, instanceOf, run`

  ### Methods 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Modulus

    public Modulus()

- ## Method Details

  - ### eval

    public Object eval(Object l, Object r) throws EvaluationException
    Description copied from class: `BinaryFunction`
    Evaluate the function
    Specified by:
      `eval` in class `BinaryFunction`
    Parameters:
      `l` - lhs argument
      `r` - rhs argument
    Returns:
      the results
    Throws:
      `EvaluationException` - if the function cannot be evaluated.

  - ### mod

    public Object mod(Object l, Object r) throws EvaluationException
    Throws:
      `EvaluationException`

  - ### evaluate

    public double evaluate(double l, double r)
    Specified by:
      `evaluate` in interface `RealBinaryFunction`