net.sf.jga.fn.arithmetic

Interface IntegerArithmetic<T>

public interface IntegerArithmetic<T extends Number> extends Arithmetic<T>

Defines arithmetic operations appropriate for Integral Numbers.

An implementation of IntegerArithmetic for classes (such as BigInteger) that provide the appropriate operations can simply map these methods to the methods provided by the Number. For the reference types, the implementation will need to dereference the arguments, perform the specified operation on the resulting primitives, and box up the result in a new reference type.

Implementations of IntegerArithmetic for user-defined Number classes must be registered with the ArithmeticFactory class. See the Arithmetic class for details.

Copyright © 2003 David A. Hall

Author: David A. Hall

Method Summary
Tmodulus(T x, T y)
For numeric arguments x and y, returns x % y

Method Detail

modulus

public T modulus(T x, T y)
For numeric arguments x and y, returns x % y

Returns: the modulus of the two arguments