diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-09-02 08:17:37 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-09-02 08:17:37 +0000 |
commit | 24458a9f0f5f787724aa74f98aadab7a373f8528 (patch) | |
tree | 66e2f50d70a213a6b475a5298e7f5c4ba402e675 /sub1sp.c | |
parent | 376944521bbd5237bb0d55b04e834a8981ed1043 (diff) | |
download | mpfr-24458a9f0f5f787724aa74f98aadab7a373f8528.tar.gz |
Do not put expressions with side effects in MPFR_ASSERTN.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3771 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub1sp.c')
-rw-r--r-- | sub1sp.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -32,13 +32,17 @@ int mpfr_sub1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode); int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode) { mpfr_t tmpa, tmpb, tmpc; - int inexact, inexact2; + int inexb, inexc, inexact, inexact2; mpfr_init2 (tmpa, MPFR_PREC (a)); mpfr_init2 (tmpb, MPFR_PREC (b)); mpfr_init2 (tmpc, MPFR_PREC (c)); - MPFR_ASSERTN (mpfr_set (tmpb, b, GMP_RNDN) == 0); - MPFR_ASSERTN (mpfr_set (tmpc, c, GMP_RNDN) == 0); + + inexb = mpfr_set (tmpb, b, GMP_RNDN); + MPFR_ASSERTN (inexb == 0); + + inexc = mpfr_set (tmpc, c, GMP_RNDN); + MPFR_ASSERTN (inexc == 0); inexact2 = mpfr_sub1 (tmpa, tmpb, tmpc, rnd_mode); inexact = mpfr_sub1sp2(a, b, c, rnd_mode); |