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