aboutsummaryrefslogtreecommitdiff
path: root/miscutils/dc.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-10-20 08:43:10 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-10-20 08:43:10 +0000
commit078323010b5d88485748d05e512d451b876992b5 (patch)
treee7111140dd305eeedee2c4a3cfb0c0f45fc29a34 /miscutils/dc.c
parentb730474bda4a964930e8013301ace7b49a0c5726 (diff)
downloadbusybox-078323010b5d88485748d05e512d451b876992b5.tar.gz
busybox-078323010b5d88485748d05e512d451b876992b5.tar.bz2
dc: conditionalize parts which require libm
Diffstat (limited to 'miscutils/dc.c')
-rw-r--r--miscutils/dc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/miscutils/dc.c b/miscutils/dc.c
index 47ec060c8..7d5886eb2 100644
--- a/miscutils/dc.c
+++ b/miscutils/dc.c
@@ -53,12 +53,14 @@ static void mul(void)
push(pop() * pop());
}
+#if ENABLE_FEATURE_DC_LIBM
static void power(void)
{
double topower = pop();
push(pow(pop(), topower));
}
+#endif
static void divide(void)
{
@@ -137,9 +139,11 @@ static const struct op operators[] = {
{"mul", mul},
{"/", divide},
{"div", divide},
+#if ENABLE_FEATURE_DC_LIBM
{"**", power},
{"exp", power},
{"pow", power},
+#endif
{"%", mod},
{"mod", mod},
{"and", and},