summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-09 23:18:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-09 23:18:04 +0000
commit3e5f70a8153f8ec955af1c6bc721f2e3ea1814a5 (patch)
tree29da7e6c2a3d146f50323f12573e3ba4fb5bbb64 /math.c
parent4b731d3bc973dae866211d6f6f9574300718cfe7 (diff)
* math.c (log2): may be a macro.
* parse.y (args, block_param, f_args): pass f_post_arg to #params. * util.c (powersOf10): constified. * ext/readline/readline.c: include extconf.h first. * ext/ripper/eventids2.c: removed tLAMBDA_ARG. * ext/tk/tcltklib.c (lib_fromUTF8_core): removed conflict. * ext/tk/tkutil/tkutil.c (cbsubst_get_subst_arg): rb_id2name() is defined as const now. * ext/win32ole/win32ole.c (fole_missing): ditto. * lib/mkmf.rb (create_makefile): force to create extconf header. * lib/optparse.rb (order!): use Proc#yield. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 d7b264c..4cdcbc7 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);