public Double calculate(Double first, char operator, Double second) {
        switch (operator) {
            case '+':
                return first + second;
            case '-':
                return first - second;
            case '*':
                return first * second;
            case '/':
                return first / second;
            case '^':
                return Math.pow(first, second);
            case '_':
                return Math.pow(first, -second);
            case '@':
                return first * -second;
            case '#':
                return first / -second;
        }
        return 0.0;
    }