summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-15 14:42:57 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-15 14:42:57 +0000
commit7fa469c7d1f80e8dfb712054c399215fa87ed823 (patch)
treea0b22195c66ed18f013933859a756500d31a633d /log.c
parentb645ffe10f08d77aa1f43d126736f454cf8779c9 (diff)
downloadmpfr-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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/log.c b/log.c
index 4238b4048..024de8cce 100644
--- a/log.c
+++ b/log.c
@@ -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 */