Implement equation evaluate by stack with fraction support. Input equation by array of elements. Element can be number, fraction, operator and parentheses.
Handle equation when already know all terms and operators.
❯ yarn dev
Start!!!
Compute: 1 + 2 * 3 = 3
Compute: 1 + 2 * 3 = 7
Compute: (1 + 2) * 3 = 9
Compute: 1 + (1/2) = 1.5
Compute: 1 + (1/3) = 1.3333333333333333
Compute: 1 + (1/3) + (1/2)= 1.8333333333333333
Finish!!!
Start Fraction!!!
Compute: 1 + 2 * 3 = 3/1
Compute: 1 + 2 * 3 = 7/1
Compute: (1 + 2) * 3 = 9/1
Compute: 1 + (1/2) = 3/2
Compute: 1 + (1/3) = 4/3
Compute: 1 + (1/3) + (1/2)= 11/6
Finish Fraction!!!