aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/floatfns.c25
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 @@
12013-06-20 Paul Eggert <eggert@cs.ucla.edu>
2
3 * floatfns.c (Flog10): Move to Lisp (marked obsolete there).
4
52013-06-20 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
6
7 * floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
8 base is 2; this is more accurate.
9
12013-06-19 Juanma Barranquero <lekktu@gmail.com> 102013-06-19 Juanma Barranquero <lekktu@gmail.com>
2 11
3 * sound.c (string_default): Move to !WINDOWSNT section. 12 * 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/>. */
25/* C89 requires only the following math.h functions, and Emacs omits 25/* C89 requires only the following math.h functions, and Emacs omits
26 the starred functions since we haven't found a use for them: 26 the starred functions since we haven't found a use for them:
27 acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod, 27 acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod,
28 frexp, ldexp, log, log10, *modf, pow, sin, *sinh, sqrt, tan, *tanh. 28 frexp, ldexp, log, log10 [via (log X 10)], *modf, pow, sin, *sinh,
29 sqrt, tan, *tanh.
29 30
30 C99 and C11 require the following math.h functions in addition to 31 C99 and C11 require the following math.h functions in addition to
31 the C89 functions. Of these, Emacs currently exports only the 32 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/>. */
33 acosh, atanh, cbrt, *copysign, erf, erfc, exp2, expm1, fdim, fma, 34 acosh, atanh, cbrt, *copysign, erf, erfc, exp2, expm1, fdim, fma,
34 fmax, fmin, fpclassify, hypot, ilogb, isfinite, isgreater, 35 fmax, fmin, fpclassify, hypot, ilogb, isfinite, isgreater,
35 isgreaterequal, isinf, isless, islessequal, islessgreater, *isnan, 36 isgreaterequal, isinf, isless, islessequal, islessgreater, *isnan,
36 isnormal, isunordered, lgamma, log1p, log2, *logb (approximately), 37 isnormal, isunordered, lgamma, log1p, *log2 [via (log X 2)], *logb
37 lrint/llrint, lround/llround, nan, nearbyint, nextafter, 38 (approximately), lrint/llrint, lround/llround, nan, nearbyint,
38 nexttoward, remainder, remquo, *rint, round, scalbln, scalbn, 39 nextafter, nexttoward, remainder, remquo, *rint, round, scalbln,
39 signbit, tgamma, trunc. 40 scalbn, signbit, tgamma, trunc.
40 */ 41 */
41 42
42#include <config.h> 43#include <config.h>
@@ -252,21 +253,16 @@ If the optional argument BASE is given, return log ARG using that base. */)
252 253
253 if (b == 10.0) 254 if (b == 10.0)
254 d = log10 (d); 255 d = log10 (d);
256#if HAVE_LOG2
257 else if (b == 2.0)
258 d = log2 (d);
259#endif
255 else 260 else
256 d = log (d) / log (b); 261 d = log (d) / log (b);
257 } 262 }
258 return make_float (d); 263 return make_float (d);
259} 264}
260 265
261DEFUN ("log10", Flog10, Slog10, 1, 1, 0,
262 doc: /* Return the logarithm base 10 of ARG. */)
263 (Lisp_Object arg)
264{
265 double d = extract_float (arg);
266 d = log10 (d);
267 return make_float (d);
268}
269
270DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0, 266DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0,
271 doc: /* Return the square root of ARG. */) 267 doc: /* Return the square root of ARG. */)
272 (Lisp_Object arg) 268 (Lisp_Object arg)
@@ -564,7 +560,6 @@ syms_of_floatfns (void)
564 defsubr (&Sexp); 560 defsubr (&Sexp);
565 defsubr (&Sexpt); 561 defsubr (&Sexpt);
566 defsubr (&Slog); 562 defsubr (&Slog);
567 defsubr (&Slog10);
568 defsubr (&Ssqrt); 563 defsubr (&Ssqrt);
569 564
570 defsubr (&Sabs); 565 defsubr (&Sabs);