summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'math.c')
-rw-r--r--math.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/math.c b/math.c
index d7b264cccc..4cdcbc7471 100644
--- a/math.c
+++ b/math.c
@@ -322,12 +322,16 @@ math_log(int argc, VALUE *argv)
return rb_float_new(d);
}
+#ifndef log2
#ifndef HAVE_LOG2
double
log2(double x)
{
return log10(x)/log10(2.0);
}
+#else
+extern double log2(double);
+#endif
#endif
/*
@@ -340,7 +344,6 @@ log2(double x)
static VALUE
math_log2(VALUE obj, VALUE x)
{
- extern double log2(double);
double d;
Need_Float(x);