@Override
	public Expression evaluate(Expression leftSideOperand, Expression rightSideOperand) 
	{
		if (Operator.outputMode == Calculate.OUTPUT_EXACT_MODE)
		{
			//try to evaluate using operands as fractions first. if fails, try to use them
			//as numbers. if still fails, evaluate treating operands as expressions
			if (leftSideOperand instanceof Number && rightSideOperand instanceof Number)
			{
				if (leftSideOperand instanceof Fraction && rightSideOperand instanceof Fraction)
				{
					return ( (Fraction) leftSideOperand ).subtract( (Fraction) rightSideOperand );
				} else
				{
					return new Number( ((Number) leftSideOperand).subtract( (Number) rightSideOperand).getValue());
				}
			} else
			{
				return leftSideOperand.subtract(rightSideOperand);
			}
		} else
		{
			if (leftSideOperand instanceof Number && rightSideOperand instanceof Number)
			{
				return new Number( ((Number) leftSideOperand ).subtract( ((Number) rightSideOperand )).getValue());
			} else
			{
				//TODO remove assert after testing
				assert false;
				return null;
			}
		}
	}