OSDN Git Service

- implement log2()
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 6 Oct 2008 10:24:41 +0000 (10:24 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 6 Oct 2008 10:24:41 +0000 (10:24 -0000)
libm/Makefile.in
libm/w_log2.c [new file with mode: 0644]

index 7e72d8a..48d5c47 100644 (file)
@@ -69,7 +69,7 @@ libm_CSRC := \
        s_tanh.c s_trunc.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c \
        w_cabs.c w_cosh.c w_drem.c w_exp.c w_fmod.c w_gamma.c \
        w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \
-       w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c \
+       w_log.c w_log2.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c \
        w_sqrt.c nan.c carg.c s_llrint.c \
        s_fpclassify.c s_fpclassifyf.c s_signbit.c s_signbitf.c \
        s_isnan.c s_isnanf.c s_isinf.c s_isinff.c s_finitef.c \
diff --git a/libm/w_log2.c b/libm/w_log2.c
new file mode 100644 (file)
index 0000000..ec274f7
--- /dev/null
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Copyright (C) 2008 by Bernhard Reutner-Fischer <uclibc@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+#include <math.h>
+#include "math_private.h"
+
+double log2 (double d)
+{
+       return __ieee754_log2 (d);
+}
+libm_hidden_def(log2)