com.graphbuilder.math.func
Class ModFunction

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

public class ModFunction
extends java.lang.Object
implements Function

The mod function.


Constructor Summary
ModFunction()
           
 
Method Summary
 boolean acceptNumParam(int numParam)
          Returns true only for 2 parameters, false otherwise.
 double of(double[] d, int numParam)
          Returns the value of x % y, where x = d[0] and y = d[1].
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ModFunction

public ModFunction()
Method Detail

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 java.lang.String toString()