diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-11-04 13:15:26 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-11-04 13:15:26 +0000 |
commit | abfa7f839fabfe6a797057128abff86d598076d9 (patch) | |
tree | 478f997f6445673a3f535f08caf32f9e7075ea33 /div.c | |
parent | 342b90d25ebeab276e971826f3a1c8ffbb8f98a6 (diff) | |
download | mpfr-abfa7f839fabfe6a797057128abff86d598076d9.tar.gz |
+ Remove MPFR_CLEAR_NAN and MPFR_CLEAR_INF. Only use MPFR_CLEAR_FLAGS.
MPFR_SET_INF, MPFR_SET_ZERO and MPFR_SET_ZERO must clear the flags before setting them.
+ Add a new test in tacosh.c : check Inf / Nan flags.
+ Use MPFR_IS_SINGULAR in all the remaining files.
+ Fix the use of MPFR_CLEAR_FLAGS.
+ mpfr-impl.h auto include gmp.h, gmp-impl.h, mpfr.h and limits.h.
+ Rename _PROTO to _MPFR_PROTO, and remove _GMP_PROTO.
+ Add MPFR_INT_SIGN macro.
+ Encapsulate a few more the sign.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2529 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'div.c')
-rw-r--r-- | div.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -58,7 +58,6 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode) MPFR_SET_NAN(q); MPFR_RET_NAN; } - MPFR_CLEAR_NAN(q); sign_quotient = MPFR_MULT_SIGN( MPFR_SIGN(u) , MPFR_SIGN(v) ); MPFR_SET_SIGN(q, sign_quotient); if (MPFR_IS_INF(u)) @@ -74,14 +73,11 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode) MPFR_RET(0); } } - else - if (MPFR_IS_INF(v)) - { - MPFR_CLEAR_INF(q); - MPFR_SET_ZERO(q); - MPFR_RET(0); - } - MPFR_CLEAR_INF(q); /* clear Inf flag */ + else if (MPFR_IS_INF(v)) + { + MPFR_SET_ZERO(q); + MPFR_RET(0); + } if (MPFR_IS_ZERO(v)) { if (MPFR_IS_ZERO(u)) @@ -95,7 +91,7 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode) MPFR_RET(0); } } - if (MPFR_IS_ZERO(u)) + else if (MPFR_IS_ZERO(u)) { MPFR_SET_ZERO(q); MPFR_RET(0); @@ -103,7 +99,8 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode) /* Never reach this !*/ MPFR_ASSERTN(1); } - + MPFR_CLEAR_FLAGS(q); + sign_quotient = MPFR_MULT_SIGN( MPFR_SIGN(u) , MPFR_SIGN(v) ); MPFR_SET_SIGN(q, sign_quotient); |