diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-12 16:54:28 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-12 16:54:28 +0000 |
commit | b7307b74a0d4d766c1ba2c5d14f8ef918debc597 (patch) | |
tree | a5bbe3b493a5ea33eec5fa75cea859c2c4129fbc /add.c | |
parent | 750a34aaecd11ac48fcc73375172df708d0da844 (diff) | |
download | mpfr-b7307b74a0d4d766c1ba2c5d14f8ef918debc597.tar.gz |
improved coverage
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2695 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'add.c')
-rw-r--r-- | add.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -33,6 +33,7 @@ mpfr_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) MPFR_SET_NAN(a); MPFR_RET_NAN; } + /* neither b nor c is NaN here */ else if (MPFR_IS_INF(b)) { if (!MPFR_IS_INF(c) || MPFR_SIGN(b) == MPFR_SIGN(c)) @@ -53,6 +54,7 @@ mpfr_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) MPFR_SET_SAME_SIGN(a, c); MPFR_RET(0); /* exact */ } + /* now either b or c is zero */ else if (MPFR_IS_ZERO(b)) { if (MPFR_IS_ZERO(c)) @@ -66,12 +68,11 @@ mpfr_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) } return mpfr_set(a, c, rnd_mode); } - else if (MPFR_IS_ZERO(c)) + else /* necessarily c is 0 */ { + MPFR_ASSERTD(MPFR_IS_ZERO(c)); return mpfr_set(a, b, rnd_mode); } - /* Should never reach here */ - MPFR_ASSERTN(0); } MPFR_ASSERTD(MPFR_IS_PURE_FP(b) && MPFR_IS_PURE_FP(c)); |