emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109944: * floatfns.c (Ftan): Use tan


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109944: * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
Date: Sat, 08 Sep 2012 12:57:32 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109944
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sat 2012-09-08 12:57:32 -0700
message:
  * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
  
  This produces more-accurate results.
modified:
  src/ChangeLog
  src/floatfns.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-08 17:22:15 +0000
+++ b/src/ChangeLog     2012-09-08 19:57:32 +0000
@@ -1,3 +1,8 @@
+2012-09-08  Paul Eggert  <address@hidden>
+
+       * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
+       This produces more-accurate results.
+
 2012-09-08  Jan Djärv  <address@hidden>
 
        * nsterm.m (updateFrameSize): Call setFrame: on the view when size

=== modified file 'src/floatfns.c'
--- a/src/floatfns.c    2012-09-07 08:46:44 +0000
+++ b/src/floatfns.c    2012-09-08 19:57:32 +0000
@@ -265,12 +265,12 @@
   (register Lisp_Object arg)
 {
   double d = extract_float (arg);
+#ifdef FLOAT_CHECK_DOMAIN
   double c = cos (d);
-#ifdef FLOAT_CHECK_DOMAIN
   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);
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]