summaryrefslogtreecommitdiff
path: root/src/floatfns.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-08 12:57:32 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-08 12:57:32 -0700
commiteabf0404414f2828c08d1d5d8fab4740670e7541 (patch)
tree221b650766b415e2c0843ea1db5d5e49d8bacebf /src/floatfns.c
parent0b3b1d23224845e760ad7ef6e316cbac05f54093 (diff)
downloademacs-eabf0404414f2828c08d1d5d8fab4740670e7541.tar.gz
* floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
This produces more-accurate results.
Diffstat (limited to 'src/floatfns.c')
-rw-r--r--src/floatfns.c4
1 files changed, 2 insertions, 2 deletions
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,
(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);
}