public BigDecimal getResult() throws CalculatorException, BinaryOperatorException {
        while (!expressionStack.operatorStack.isEmpty()) {
            evaluateOperator();
        }
        if (!expressionStack.bracketStack.isEmpty()) {
            throw new BinaryOperatorException("missing closed bracket");
        }
        BigDecimal res = expressionStack.operandStack.pop();
        return res;
    }