diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-09-14 08:09:05 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-09-14 08:09:05 +0000 |
commit | 896a86d0599c02dd094c566d0db719e3465afc1a (patch) | |
tree | ce3b29d45b47f25e4951f08d9a2df67336fb5bed /tests | |
parent | bdd01a2438a69d5e050b4744b6cc56ca9333eb1e (diff) | |
download | mpfr-896a86d0599c02dd094c566d0db719e3465afc1a.tar.gz |
[tests/tdiv.c] Improved code readability, fixing a small bug
(found by David Binderman using cppcheck) at the same time.
This bug could only affect the error message if the test failed.
(merged changesets r10871-10872 from the trunk)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10873 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tdiv.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/tdiv.c b/tests/tdiv.c index e9052471f..160153482 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -644,7 +644,8 @@ check_inexact (void) mpfr_set_prec (u, 2); mpfr_set_str_binary (u, "0.1E0"); mpfr_set_prec (y, 28); - if ((inexact = test_div (y, x, u, MPFR_RNDN) >= 0)) + inexact = test_div (y, x, u, MPFR_RNDN); + if (inexact >= 0) { printf ("Wrong inexact flag (1): expected -1, got %d\n", inexact); @@ -656,7 +657,8 @@ check_inexact (void) mpfr_set_prec (u, 15); mpfr_set_str_binary (u, "0.101101000001100E-1"); mpfr_set_prec (y, 92); - if ((inexact = test_div (y, x, u, MPFR_RNDN)) <= 0) + inexact = test_div (y, x, u, MPFR_RNDN); + if (inexact <= 0) { printf ("Wrong inexact flag for rnd=MPFR_RNDN(1): expected 1, got %d\n", inexact); |