diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-13 13:44:41 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-13 13:44:41 +0000 |
commit | 1931b8fa551b44b3ac787f2b077a231c4d339829 (patch) | |
tree | ddec24d0ab243d55f3e953f2b0d372d8773ecc13 /div_ui.c | |
parent | 006f3c4678c66c90ad60336c1a89be3bec7f0c2c (diff) | |
download | mpfr-1931b8fa551b44b3ac787f2b077a231c4d339829.tar.gz |
improved test coverage
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2706 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'div_ui.c')
-rw-r--r-- | div_ui.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -46,8 +46,9 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) MPFR_SET_SAME_SIGN(y, x); MPFR_RET(0); } - else if (MPFR_IS_ZERO(x)) + else { + MPFR_ASSERTD(MPFR_IS_ZERO(x)); if (u == 0)/* 0/0 is NaN */ { MPFR_SET_NAN(y); @@ -59,8 +60,6 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) MPFR_RET(0); } } - else - MPFR_ASSERTN(0); } if (MPFR_UNLIKELY(u == 0)) @@ -161,7 +160,8 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) mpfr_add_one_ulp (y, rnd_mode); MPFR_RET(-1); /* result is inexact */ - case GMP_RNDN: + default: + MPFR_ASSERTD(rnd_mode == GMP_RNDN); if (sh && d < (MP_LIMB_T_ONE << (sh - 1))) MPFR_RET(-MPFR_INT_SIGN(x)); else if (sh && d > (MP_LIMB_T_ONE << (sh - 1))) @@ -184,8 +184,6 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) else MPFR_RET(-MPFR_INT_SIGN(x)); } - default: - MPFR_ASSERTN(0); } return 0; /* To avoid warning*/ } |