string-input-string-output c++ calculator module
The package include the "calculator" module. Simply include "calcualtor.h" to use the "calculate" function.
Compile using the included Makefile (for Linux based) or any system builder. Function takes in a string argument and output a string argument. Calculator works for complex numbers. Below is the syntax code.
function | syntax | code |
---|---|---|
+,-,*, / | same | 1,(1,2,3,4) |
^ | ^ | 1,5 |
sin, cos, tan | s(, c(, t( | 3,(8,9,10) |
asin, acos, atan | as(, ac(, at( | 3,(11,12,13) |
natural log | ln( | 3,14 |
square root | r( | 3,15 |
negative | _( | 3,16 |
Shunting Yard algorithm was inspired by Briliant.org (pseudocode) at https://brilliant.org/wiki/shunting-yard-algorithm/ . Project used codes and ideas from our own previous works.