src/main/java/PrefixDiff.java
/**
         * Calculate the function or operator applied to a constant or constants
         * Should convert this into a new constant!
         */
Calculate the function or operator applied to a constant or constants
Should convert this into a new constant!
Calculate the function or operator applied to a constant or constants Should convert this into a new constant!
private void calculate() {
            Double sum = null;
            switch (functionName){
                case ln:
                    sum = Math.log(left.constant);
                    break;
                case exp:
                    sum = Math.exp(left.constant);
                    break;
                case sin:
                    sum = Math.sin(left.constant);
                    break;
                case cos:
                    sum = Math.cos(left.constant);
                    break;
                case tan:
                    sum = Math.tan(left.constant);
                    break;
                case o:
                    switch (name){
                        case "+":
                            sum = left.constant + right.constant;
                            break;
                        case "-":
                            sum = left.constant - right.constant;
                            break;
                        case "*":
                            sum = left.constant * right.constant;
                            break;
                        case "/":
                            sum = left.constant / right.constant;
                            break;
                        case "^":
                            sum = Math.pow(left.constant, right.constant);
                            break;
                    }
                    break;
                default:
            }
            if (sum != null){
                setName(sum.toString());
                left = null;
                right = null;
            }
        }
private void calculate ( ) { Double sum = null ; switch ( functionName ) { case ln : sum = Math . log ( left . constant ) ; break ; case exp : sum = Math . exp ( left . constant ) ; break ; case sin : sum = Math . sin ( left . constant ) ; break ; case cos : sum = Math . cos ( left . constant ) ; break ; case tan : sum = Math . tan ( left . constant ) ; break ; case o : switch ( name ) { case "+" : sum = left . constant + right . constant ; break ; case "-" : sum = left . constant - right . constant ; break ; case "*" : sum = left . constant * right . constant ; break ; case "/" : sum = left . constant / right . constant ; break ; case "^" : sum = Math . pow ( left . constant , right . constant ) ; break ; } break ; default : } if ( sum != null ) { setName ( sum . toString ( ) ) ; left = null ; right = null ; } }
Calculate the function or operator applied to a constant or constants
 Should convert this into a new constant!
Calculate the function or operator applied to a constant or constants Should convert this into a new constant!
//noinspection EnhancedSwitchMigration // should not come here!