Class Minus

All Implemented Interfaces:
Expression

public final class Minus extends Operation
This class represents the arithmetic operation "-". The class extends an abstract superclass Operation. Other subclasses of Operation represent other arithmetic operations.
See Also:
  • Constructor Details

  • Method Details

    • op

      public int op(int l, int r)
      The actual computation of the (binary) arithmetic subtraction of two integers
      Parameters:
      l - The first integer
      r - The second integer that should be subtracted from the first
      Returns:
      The integer that is the result of the subtraction
    • op

      public Real op(Real r1, Real r2)
      The actual computation of the (binary) arithmetic subtraction of two Reals
      Specified by:
      op in class Operation
      Parameters:
      r1 - The first Real
      r2 - The second Real
      Returns:
      The (new) Real that is the result of the subtraction
    • op

      public IntegerAtom op(IntegerAtom i1, IntegerAtom i2)
      The actual computation of the (binary) arithmetic subtraction of two Integers
      Specified by:
      op in class Operation
      Parameters:
      i1 - The first IntegerAtom
      i2 - The second IntegerAtom
      Returns:
      The (new) IntegerAtom that is the result of the subtraction
    • op

      public Complex op(Complex c1, Complex c2)
      Description copied from class: Operation
      Abstract method representing the actual binary arithmetic operation to compute on Complexes
      Specified by:
      op in class Operation
      Parameters:
      c1 - first Complex of the binary operation
      c2 - second Complex of the binary operation
      Returns:
      result of computing the binary operation
    • op

      public Rationnal op(Rationnal q1, Rationnal q2)
      Description copied from class: Operation
      Abstract method representing the actual binary arithmetic operation to compute on Rationnals
      Specified by:
      op in class Operation
      Parameters:
      q1 - first Rationnal of the binary operation
      q2 - second Rationnal of the binary operation
      Returns:
      result of computing the binary operation