summaryrefslogtreecommitdiffstats
path: root/4
diff options
context:
space:
mode:
Diffstat (limited to '4')
-rw-r--r--4/10.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/4/10.c b/4/10.c
index a57effb..769e606 100644
--- a/4/10.c
+++ b/4/10.c
@@ -24,6 +24,15 @@ void clear();
int mgetline();
int getop(char[]);
+/* Reverse Polish notation calculator
+ - single uppercase and lowercase characters are variables (syntax 2 A =);
+ - special variable LOUT for the last printed value.
+ - mathematical functions: sin, cos, tan, exp, pow.
+ - custom functions: swp (swap top 2 values), dup (duplicate last value),
+ top (peek at the stack top), cls (clear stack).
+ - operators: +, -, *, /, % and =
+ - press enter to print the value at the top of the stack.
+ */
int main(int argc, char *argv[]) {
int type, op1, op2;
char s[MAXOP];