From 280dbfc1a2b34b7fefeba9f3801e51187f1ef0ad Mon Sep 17 00:00:00 2001 From: enge Date: Sat, 30 Jun 2012 13:03:27 +0000 Subject: log.dat: add example with intermediate underflow log.c: handle intermediate underflow git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@1209 211d60ee-9f03-0410-a15a-8952a2c7a4e4 --- src/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/log.c b/src/log.c index 5358ee6..d9f19fd 100644 --- a/src/log.c +++ b/src/log.c @@ -144,8 +144,8 @@ do { \ /* w is rounded down */ inex = mpc_norm (w, op, GMP_RNDN); /* error 0.5 ulp */ - if (mpfr_inf_p (w)) - /* intermediate overflow; the logarithm may be representable */ + if (mpfr_inf_p (w) || mpfr_zero_p (w)) + /* intermediate over- or underflow; the logarithm may be representable */ break; if (inex && mpfr_cmp_ui (w, 1) == 0) /* this is like an underflow; the following call to log will -- cgit v1.2.1