Class ModFunction

java.lang.Object
com.graphbuilder.math.func.ModFunction
All Implemented Interfaces:
Function

public class ModFunction extends Object implements Function
The mod function.
  • Constructor Details

    • ModFunction

      public ModFunction()
  • Method Details

    • of

      public double of(double[] d, int numParam)
      Returns the value of x % y, where x = d[0] and y = d[1]. More precisely, the value returned is x minus the value of x / y, where x / y is rounded to the closest integer value towards 0.
      Specified by:
      of in interface Function
    • acceptNumParam

      public boolean acceptNumParam(int numParam)
      Returns true only for 2 parameters, false otherwise.
      Specified by:
      acceptNumParam in interface Function
    • toString

      public String toString()
      Overrides:
      toString in class Object