summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-cmath/src/cmath.c
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-cmath/src/cmath.c')
-rw-r--r--mrbgems/mruby-cmath/src/cmath.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mrbgems/mruby-cmath/src/cmath.c b/mrbgems/mruby-cmath/src/cmath.c
index 9eeadd019..19da2eae2 100644
--- a/mrbgems/mruby-cmath/src/cmath.c
+++ b/mrbgems/mruby-cmath/src/cmath.c
@@ -116,6 +116,11 @@ cmath_log(mrb_state *mrb, mrb_value self) {
mrb_float real, imag;
mrb_int n = mrb_get_args(mrb, "o|f", &z, &base);
+
+#ifndef M_E
+#define M_E F(exp)(1.0)
+#endif
+
if (n == 1) base = M_E;
if (cmath_get_complex(mrb, z, &real, &imag) || real < 0.0) {
mrb_complex c = CX(real,imag);