Skip to content

A calculator built in C# that translates mathematical expression into RPN (reverse polish notation) and calculates it during translation

License

Notifications You must be signed in to change notification settings

Alekarfes/RPNcalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPNcalc

A calculator built in C# that translates mathematical expression into RPN (reverse polish notation) and calculates it during translation

Examples

RPNcalc calc = new RPNcalc();
calc.Calculate("700+(2-4/2+(6))*2");
MessageBox.Show(calc.Result);
RPNcalc calc = new RPNcalc();
calc.Calculate("414 / ( 55 - 27 / 3 )");
MessageBox.Show(calc.RPN);

Right now this calculator can add, subtract, divide, multiply and process brackets. You can add any operations you want in section of RPN.cs marked with "symbol priority checking", but make sure their priority is correct.

Current priorities:

high: * /
low: + −
the lowest: ( )

About

A calculator built in C# that translates mathematical expression into RPN (reverse polish notation) and calculates it during translation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages