From 896a86d0599c02dd094c566d0db719e3465afc1a Mon Sep 17 00:00:00 2001 From: vlefevre Date: Wed, 14 Sep 2016 08:09:05 +0000 Subject: [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 --- tests/tdiv.c | 6 ++++-- 1 file 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); -- cgit v1.2.1