diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/floatfns.c | 25 |
2 files changed, 19 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 68138e46b6b..c503da29732 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2013-06-20 Paul Eggert <eggert@cs.ucla.edu> + + * floatfns.c (Flog10): Move to Lisp (marked obsolete there). + +2013-06-20 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> + + * floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the + base is 2; this is more accurate. + 2013-06-19 Juanma Barranquero <lekktu@gmail.com> * sound.c (string_default): Move to !WINDOWSNT section. diff --git a/src/floatfns.c b/src/floatfns.c index dd6d3dfe582..f3d0936f888 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -25,7 +25,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* C89 requires only the following math.h functions, and Emacs omits the starred functions since we haven't found a use for them: acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod, - frexp, ldexp, log, log10, *modf, pow, sin, *sinh, sqrt, tan, *tanh. + frexp, ldexp, log, log10 [via (log X 10)], *modf, pow, sin, *sinh, + sqrt, tan, *tanh. C99 and C11 require the following math.h functions in addition to the C89 functions. Of these, Emacs currently exports only the @@ -33,10 +34,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ acosh, atanh, cbrt, *copysign, erf, erfc, exp2, expm1, fdim, fma, fmax, fmin, fpclassify, hypot, ilogb, isfinite, isgreater, isgreaterequal, isinf, isless, islessequal, islessgreater, *isnan, - isnormal, isunordered, lgamma, log1p, log2, *logb (approximately), - lrint/llrint, lround/llround, nan, nearbyint, nextafter, - nexttoward, remainder, remquo, *rint, round, scalbln, scalbn, - signbit, tgamma, trunc. + isnormal, isunordered, lgamma, log1p, *log2 [via (log X 2)], *logb + (approximately), lrint/llrint, lround/llround, nan, nearbyint, + nextafter, nexttoward, remainder, remquo, *rint, round, scalbln, + scalbn, signbit, tgamma, trunc. */ #include <config.h> @@ -252,21 +253,16 @@ If the optional argument BASE is given, return log ARG using that base. */) if (b == 10.0) d = log10 (d); +#if HAVE_LOG2 + else if (b == 2.0) + d = log2 (d); +#endif else d = log (d) / log (b); } return make_float (d); } -DEFUN ("log10", Flog10, Slog10, 1, 1, 0, - doc: /* Return the logarithm base 10 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = log10 (d); - return make_float (d); -} - DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0, doc: /* Return the square root of ARG. */) (Lisp_Object arg) @@ -564,7 +560,6 @@ syms_of_floatfns (void) defsubr (&Sexp); defsubr (&Sexpt); defsubr (&Slog); - defsubr (&Slog10); defsubr (&Ssqrt); defsubr (&Sabs); |
