aboutsummaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorbeppu <beppu@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-06-21 18:00:46 +0000
committerbeppu <beppu@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-06-21 18:00:46 +0000
commit912529febe6a1ac3a43e07605bfd32e030cc12bd (patch)
tree8687adb45e009fe47f40f32d964d56234ce35d44 /math.c
parente67a357fcb01964b745733175b474cecf456d8d5 (diff)
downloadbusybox-w32-912529febe6a1ac3a43e07605bfd32e030cc12bd.tar.gz
busybox-w32-912529febe6a1ac3a43e07605bfd32e030cc12bd.tar.bz2
busybox-w32-912529febe6a1ac3a43e07605bfd32e030cc12bd.zip
+ made it so that you can use the mnemonics
(add, sub, mul, div) in lieu of (+, -, *, /) git-svn-id: svn://busybox.net/trunk/busybox@676 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'math.c')
-rw-r--r--math.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/math.c b/math.c
index eb8f331fd..15a826ce4 100644
--- a/math.c
+++ b/math.c
@@ -92,15 +92,19 @@ struct op {
92}; 92};
93 93
94static const struct op operators[] = { 94static const struct op operators[] = {
95 {"+", add}, 95 {"+", add},
96 {"-", sub}, 96 {"add", add},
97 {"*", mul}, 97 {"-", sub},
98 {"/", divide}, 98 {"sub", sub},
99 {"*", mul},
100 {"mul", mul},
101 {"/", divide},
102 {"div", divide},
99 {"and", and}, 103 {"and", and},
100 {"or", or}, 104 {"or", or},
101 {"not", not}, 105 {"not", not},
102 {"eor", eor}, 106 {"eor", eor},
103 {0, 0} 107 {0, 0}
104}; 108};
105 109
106static void stack_machine(const char *argument) 110static void stack_machine(const char *argument)