/* $Id$
 */
package calc;

/** Difference formulas.
 * @author Gary T. Leavens
 */
public class Diff extends BinaryFormula {

    /**
     * Initialize this Formula object to be the difference of the given registers.
     * @param left the left register's number.
     * @param right the right register's number
     */
    //@ requires 0 <= left && left < Registers.NUM_REGS;
    //@ requires 0 <= right && right < Registers.NUM_REGS;
    //@ ensures this.left == left && this.right == right; 
    public Diff(int left, int right) {
        super(left, right);
    }

    // documentation comment and specification inherited
    public double evaluate() {
        return regValue() - reg2Value();
    }

}
