summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrevol <revol@280ebfd0-de03-0410-8827-d642c229c3f4>2001-04-17 18:23:18 +0000
committerrevol <revol@280ebfd0-de03-0410-8827-d642c229c3f4>2001-04-17 18:23:18 +0000
commit40a6f32b48c2a168a83b6551f1e5d81368c3f12a (patch)
tree071530daaa3a1e5470443f7e7b084b5f855e0688
parentf8cede30ac01239c919274c9fb2ca45bf8e8c911 (diff)
downloadmpfr-40a6f32b48c2a168a83b6551f1e5d81368c3f12a.tar.gz
Case where argument < 0 included, NR 17-04-2001
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1076 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--log.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/log.c b/log.c
index 726a7bd5b..c15e1e2ab 100644
--- a/log.c
+++ b/log.c
@@ -64,6 +64,12 @@ mpfr_log (r, a, rnd_mode)
return 1;
}
+ /* If a is negative, the result is NaN */
+ if (MPFR_ISNEG(a)) {
+ MPFR_SET_NAN(r);
+ return 1;
+ }
+
MPFR_CLEAR_NAN(r);
/* check for infinity before zero */