summaryrefslogtreecommitdiff
path: root/src/yn.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-03-03 16:18:16 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2011-03-03 16:18:16 +0000
commitb973c53c267de852c2f85c08aeb42893ad1a2ffc (patch)
treefbaabad7b3fc11c608fa1d342c9e6cb5d64cf0c8 /src/yn.c
parentd2610c367c21bf711b9987d83b53ae9c402e851f (diff)
downloadmpfr-b973c53c267de852c2f85c08aeb42893ad1a2ffc.tar.gz
[src/yn.c] Minor change.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7518 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/yn.c')
-rw-r--r--src/yn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/yn.c b/src/yn.c
index cd2e416ce..3440cce17 100644
--- a/src/yn.c
+++ b/src/yn.c
@@ -406,9 +406,9 @@ mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
}
MPFR_ZIV_FREE (loop);
- inex = (n >= 0 || (n & 1) == 0)
- ? mpfr_set (res, s2, r)
- : mpfr_neg (res, s2, r);
+ /* Assume two's complement for the test n & 1 */
+ inex = mpfr_set4 (res, s2, r, n >= 0 || (n & 1) == 0 ?
+ MPFR_SIGN (s2) : - MPFR_SIGN (s2));
mpfr_clear (y);
mpfr_clear (s1);