diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-02-04 09:14:37 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-02-04 09:14:37 +0000 |
commit | 2dd08bcfd72e852b8ef5b8404042af798111132c (patch) | |
tree | 6e4fce2f7eb9671ca237c6add38b22bfbe3aaefe /atan.c | |
parent | 6ec02bcd800e37cce7b176511f6a828c9aaa743d (diff) | |
download | mpfr-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |