package calc;

/** Difference formulas.
 * @author Gary T. Leavens
 */
public class Diff extends BinaryFormula {
    
    /**
     * Initialize this Diff object to calculate the
     * difference of the given registers.
     */
    public Diff(int left, int right) {
        super(left, right);
    }
    
    /**
     * Evaluate the formula and return its value.
     */
    /*@ also
      @   ensures (* \result is the difference of the value of
      @              the left and right register's values. *); @*/
    public double evaluate() {
        return leftValue() - rightValue();
    }
    
    public String opString() {
         return "-";
    }
}