Dc is a reverse-polish desk calculator which supports unlimited
precision arithmetic.
+config FEATURE_DC_LIBM
+ bool "Enable power and exp functions (requires libm)"
+ default n
+ depends on DC
+ help
+ Enable power and exp functions.
+ NOTE: This will require libm to be present for linking.
+
config DEVFSD
bool "devfsd (obsolete)"
default n
push(pop() * pop());
}
+#if ENABLE_FEATURE_DC_LIBM
static void power(void)
{
double topower = pop();
push(pow(pop(), topower));
}
+#endif
static void divide(void)
{
{"mul", mul},
{"/", divide},
{"div", divide},
+#if ENABLE_FEATURE_DC_LIBM
{"**", power},
{"exp", power},
{"pow", power},
+#endif
{"%", mod},
{"mod", mod},
{"and", and},