This program evaluates expressions. Type an infix expression in the form of: 2*(4^2)+123 The following operators are allowed: addition: + subtraction: - division: / or ÷ multiplication: * modulus: % integer division: // exponent: ^ or ** The following functions are allowed: pow(base, exp) sine: sin(angle) cosine: cos(angle) tangent: tan(angle) arcsine: asin(ratio) arccosine: acos(ratio) arctangent: atan(ratio) square root: sqrt(num) round down: floor(num) round up: ceil(num) round: round(num) absolute value: abs(num) max of two values: max(a, b) minimum of two values: min(a, b) There are also some pre-defined constants: π = 3.1415926535 e = 2.7182818284 γ = 0.5772156649 φ = 1.6180339887
Using Shunting-yard algorithm from wiki: https://en.wikipedia.org/wiki/Shunting-yard_algorithm Using a postfix-evaluation algorithm from: https://aquarchitect.github.io/swift-algorithm-club/Shunting%20Yard/