Skip to content

sosnowski/FSharpCalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 :)

About

Command Line Calculator in F#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages