]> git.eshelyaron.com Git - emacs.git/commitdiff
* floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 8 Sep 2012 19:57:32 +0000 (12:57 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 8 Sep 2012 19:57:32 +0000 (12:57 -0700)
This produces more-accurate results.

src/ChangeLog
src/floatfns.c

index dd4719e25c67596ac17758be70a94da1288364bf..0316e7708aff9b4722d21d631721d2a503698662 100644 (file)
@@ -1,3 +1,8 @@
+2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
+       This produces more-accurate results.
+
 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsterm.m (updateFrameSize): Call setFrame: on the view when size
index 3a95d828c0c71be0aed35bf1b1073352ad63953c..dfe063b152f2c5f3093217051f7ed3e30f825e4a 100644 (file)
@@ -265,12 +265,12 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0,
   (register Lisp_Object arg)
 {
   double d = extract_float (arg);
-  double c = cos (d);
 #ifdef FLOAT_CHECK_DOMAIN
+  double c = cos (d);
   if (c == 0.0)
     domain_error ("tan", arg);
 #endif
-  IN_FLOAT (d = sin (d) / c, "tan", arg);
+  IN_FLOAT (d = tan (d), "tan", arg);
   return make_float (d);
 }