simple calculator for column fixture test


quotient

with exception test

public function quotient() {
if( $this->number2 == 0 ) {
throw new Exception( 'division by zero' );
}
return $this->number1 / $this->number2;
}

eg.Calc
number1number2quotient()
422
90division by zero!
402
632
2173
961.5
1234
221
1051.9

sum

public function sum() {
return $this->number1 + $this->number2;
}

eg.Calc
number1number2sum()
224
629

sub

public function sub() {
return $this->number1 - $this->number2;
}

eg.Calc
number1number2sub()
221
24-2