Define `M_E` for some platforms.

parent a6994f51
...@@ -116,6 +116,11 @@ cmath_log(mrb_state *mrb, mrb_value self) { ...@@ -116,6 +116,11 @@ cmath_log(mrb_state *mrb, mrb_value self) {
mrb_float real, imag; mrb_float real, imag;
mrb_int n = mrb_get_args(mrb, "o|f", &z, &base); 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 (n == 1) base = M_E;
if (cmath_get_complex(mrb, z, &real, &imag) || real < 0.0) { if (cmath_get_complex(mrb, z, &real, &imag) || real < 0.0) {
mrb_complex c = CX(real,imag); mrb_complex c = CX(real,imag);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment