aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2007-09-06 19:51:46 +0000
committerJeff Johnston <jjohnstn@redhat.com>2007-09-06 19:51:46 +0000
commit6494ee837c60fe7507e606a8995d824bb9ed35da (patch)
treeb5c29d1db18f2a34ba336de1188529ebe43bed37
parent1eb76b8f84c8f718c98590caaebd5e38d206829a (diff)
downloadnewlib-6494ee837c60fe7507e606a8995d824bb9ed35da.zip
newlib-6494ee837c60fe7507e606a8995d824bb9ed35da.tar.gz
newlib-6494ee837c60fe7507e606a8995d824bb9ed35da.tar.bz2
2007-09-06 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h (_M_LOG2E): New log2 of e macro. (log2): Use _M_LOG2E instead of M_LOG2E. (log2f): Ditto. (M_LOG2E): Define to be _M_LOG2E.
-rw-r--r--newlib/ChangeLog7
-rw-r--r--newlib/libc/include/math.h10
2 files changed, 14 insertions, 3 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index b9551a1..187fc6a 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/include/math.h (_M_LOG2E): New log2 of e macro.
+ (log2): Use _M_LOG2E instead of M_LOG2E.
+ (log2f): Ditto.
+ (M_LOG2E): Define to be _M_LOG2E.
+
2007-09-04 Kazunori Asayama <asayama@sm.sony.co.jp>
* libm/math/wf_tgamma.c: Add missing include.
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index 9bfaca2..dc8fe9c 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -26,6 +26,10 @@ union __ldmath
_LONG_DOUBLE ld;
};
+/* Log2 of e */
+#define _M_LOG2E 1.4426950408889634074
+
+
#if defined(__GNUC__) && \
( (__GNUC__ >= 4) || \
( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) )
@@ -246,7 +250,7 @@ extern double gamma _PARAMS((double));
extern double lgamma _PARAMS((double));
extern double erf _PARAMS((double));
extern double erfc _PARAMS((double));
-#define log2(x) (log (x) / M_LOG2_E)
+#define log2(x) (log (x) / _M_LOG2_E)
#ifndef __math_68881
extern double hypot _PARAMS((double, double));
@@ -323,7 +327,7 @@ extern float gammaf _PARAMS((float));
extern float lgammaf _PARAMS((float));
extern float erff _PARAMS((float));
extern float erfcf _PARAMS((float));
-#define log2f(x) (logf (x) / (float) M_LOG2_E)
+#define log2f(x) (logf (x) / (float) _M_LOG2_E)
extern float hypotf _PARAMS((float, float));
#endif /* ! defined (_REENT_ONLY) */
@@ -420,7 +424,7 @@ extern int matherr _PARAMS((struct exception *e));
#define MAXFLOAT 3.40282347e+38F
#define M_E 2.7182818284590452354
-#define M_LOG2E 1.4426950408889634074
+#define M_LOG2E _M_LOG2E
#define M_LOG10E 0.43429448190325182765
#define M_LN2 0.69314718055994530942
#define M_LN10 2.30258509299404568402