aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-09-08 12:57:32 -0700
committerPaul Eggert2012-09-08 12:57:32 -0700
commiteabf0404414f2828c08d1d5d8fab4740670e7541 (patch)
tree221b650766b415e2c0843ea1db5d5e49d8bacebf /src
parent0b3b1d23224845e760ad7ef6e316cbac05f54093 (diff)
downloademacs-eabf0404414f2828c08d1d5d8fab4740670e7541.tar.gz
emacs-eabf0404414f2828c08d1d5d8fab4740670e7541.zip
* floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
This produces more-accurate results.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/floatfns.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index dd4719e25c6..0316e7708af 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2
3 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4 This produces more-accurate results.
5
12012-09-08 Jan Djärv <jan.h.d@swipnet.se> 62012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2 7
3 * nsterm.m (updateFrameSize): Call setFrame: on the view when size 8 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
diff --git a/src/floatfns.c b/src/floatfns.c
index 3a95d828c0c..dfe063b152f 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -265,12 +265,12 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0,
265 (register Lisp_Object arg) 265 (register Lisp_Object arg)
266{ 266{
267 double d = extract_float (arg); 267 double d = extract_float (arg);
268 double c = cos (d);
269#ifdef FLOAT_CHECK_DOMAIN 268#ifdef FLOAT_CHECK_DOMAIN
269 double c = cos (d);
270 if (c == 0.0) 270 if (c == 0.0)
271 domain_error ("tan", arg); 271 domain_error ("tan", arg);
272#endif 272#endif
273 IN_FLOAT (d = sin (d) / c, "tan", arg); 273 IN_FLOAT (d = tan (d), "tan", arg);
274 return make_float (d); 274 return make_float (d);
275} 275}
276 276