Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 550 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 550 Bytes

Command Line Calculator in F#

Usage

FSharCalc.exe "2 + 2 * (15 / 5) - 2"
FSharCalc.exe "(123 + 321 / 23) - 2"

etc.

Internally it uses FParsec to parse input string and identify numbers and operators.

Infix notation is then translated to Revers Polish Notation using Dijkstra's Shunting-yard algorithm.

Created RPN stack is then evaluated to retrieve the final result.

Unit tests included :)