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