diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-15 14:42:57 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-15 14:42:57 +0000 |
commit | 7fa469c7d1f80e8dfb712054c399215fa87ed823 (patch) | |
tree | a0b22195c66ed18f013933859a756500d31a633d /log.c | |
parent | b645ffe10f08d77aa1f43d126736f454cf8779c9 (diff) | |
download | mpfr-7fa469c7d1f80e8dfb712054c399215fa87ed823.tar.gz |
A few patches.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@870 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -64,16 +64,22 @@ mpfr_log(r, a, rnd_mode) /* If a is NaN, the result is NaN */ if (MPFR_IS_NAN(a)) - { MPFR_SET_NAN(r); return 1; } + { MPFR_CLEAR_FLAGS(r); MPFR_SET_NAN(r); return 1; } if (MPFR_IS_ZERO(a)) { - MPFR_SET_INF(r); if (MPFR_SIGN(r) != -1) { MPFR_CHANGE_SIGN(r); } + MPFR_CLEAR_FLAGS(r); + MPFR_SET_INF(r); + if (MPFR_SIGN(r) != -1) { MPFR_CHANGE_SIGN(r); } + return 1; } if (MPFR_IS_INF(a)) { - MPFR_SET_INF(r); if (MPFR_SIGN(r) != 1) { MPFR_CHANGE_SIGN(r); } + MPFR_CLEAR_FLAGS(r); + MPFR_SET_INF(r); + if (MPFR_SIGN(r) != 1) { MPFR_CHANGE_SIGN(r); } + return 1; } /* Now we can clear the flags without damage even if r == a */ |