diff options
author | beppu <beppu@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-06-21 18:00:46 +0000 |
---|---|---|
committer | beppu <beppu@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-06-21 18:00:46 +0000 |
commit | 912529febe6a1ac3a43e07605bfd32e030cc12bd (patch) | |
tree | 8687adb45e009fe47f40f32d964d56234ce35d44 /math.c | |
parent | e67a357fcb01964b745733175b474cecf456d8d5 (diff) | |
download | busybox-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.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -92,15 +92,19 @@ struct op { | |||
92 | }; | 92 | }; |
93 | 93 | ||
94 | static const struct op operators[] = { | 94 | static 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 | ||
106 | static void stack_machine(const char *argument) | 110 | static void stack_machine(const char *argument) |