summaryrefslogtreecommitdiff
path: root/atan.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-02-04 09:14:37 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-02-04 09:14:37 +0000
commit2dd08bcfd72e852b8ef5b8404042af798111132c (patch)
tree6e4fce2f7eb9671ca237c6add38b22bfbe3aaefe /atan.c
parent6ec02bcd800e37cce7b176511f6a828c9aaa743d (diff)
downloadmpfr-2dd08bcfd72e852b8ef5b8404042af798111132c.tar.gz
Fix bug of atan(-1) (wrong sign).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3276 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'atan.c')
-rw-r--r--atan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/atan.c b/atan.c
index f331e59ab..afe219a89 100644
--- a/atan.c
+++ b/atan.c
@@ -261,9 +261,10 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mp_rnd_t rnd_mode)
comparaison = mpfr_cmp_ui (xp, 1);
if (MPFR_UNLIKELY (comparaison == 0))
{
+ int neg = MPFR_IS_NEG (x);
inexact = mpfr_const_pi (atan, MPFR_IS_POS (x) ? rnd_mode
: MPFR_INVERT_RND (rnd_mode));
- if (MPFR_IS_NEG (x))
+ if (neg)
{
inexact = -inexact;
MPFR_CHANGE_SIGN (atan);