about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 4f9dd2e..b4c092f 100644
--- a/main.c
+++ b/main.c
@@ -68,6 +68,10 @@ int main() {
 	  s.stk.val[s.stk.count-2] = s.stk.val[s.stk.count-2]/s.stk.val[s.stk.count-1];
 	  s.stk.val[s.stk.count--] = 0; /* lower count by 1 */
 	  s.last_op = '/';
+	} else if (operator == '^') {
+	  s.stk.val[s.stk.count-2] = pow(s.stk.val[s.stk.count-2],s.stk.val[s.stk.count-1]);
+	  s.stk.val[s.stk.count--] = 0; /* lower count by 1 */
+	  s.last_op = '^';
 	} else;
       } else if (t == FUNCTION) {
 	/* check for special commands, else pass to exec() */