/** * Apply this operator to the supplied arguments * * @param first the first argument * @param second the second argument * @return the result */ protected double applyOperator(double first, double second) { switch (m_operator) { case '+': return (first + second); case '-': return (first - second); case '*': return (first * second); case '/': return (first / second); case '^': return Math.pow(first, second); } return Double.NaN; }