summaryrefslogtreecommitdiff
path: root/src/sub1sp.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2019-09-05 10:02:14 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2019-09-05 10:02:14 +0000
commit305c5946bcce38c6d7c628f406849f8cc96943ce (patch)
tree51b686e4f99ca43f982be75e17a8a90c6fedc6e3 /src/sub1sp.c
parentfba063c7d3e1ef81f5cd409e5a0ac9a42c7f1836 (diff)
downloadmpfr-305c5946bcce38c6d7c628f406849f8cc96943ce.tar.gz
[src/sub1sp.c] For the --enable-assert=full test, improved output of
ternary value and flags, like in r13582 for mpfr_add1sp. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13602 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/sub1sp.c')
-rw-r--r--src/sub1sp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sub1sp.c b/src/sub1sp.c
index 022251917..227593b21 100644
--- a/src/sub1sp.c
+++ b/src/sub1sp.c
@@ -75,6 +75,10 @@ int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
inexact = mpfr_sub1sp_ref (a, b, c, rnd_mode);
flags = __gmpfr_flags;
+ /* Convert the ternary values to (-1,0,1). */
+ inexact2 = VSIGN (inexact2);
+ inexact = VSIGN (inexact);
+
if (! mpfr_equal_p (tmpa, a) || inexact != inexact2 || flags != flags2)
{
fprintf (stderr, "sub1 & sub1sp return different values for %s\n"
@@ -90,9 +94,10 @@ int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
mpfr_fdump (stderr, tmpa);
fprintf (stderr, "sub1sp: ");
mpfr_fdump (stderr, a);
- fprintf (stderr, "Ternary value: sub1 = %d, sub1sp = %d\n"
- "Flags: sub1 = %u, sub1sp = %u\n",
- inexact2, inexact, flags2, flags);
+ fprintf (stderr, "sub1 : ternary = %2d, flags =", inexact2);
+ flags_fout (stderr, flags2);
+ fprintf (stderr, "sub1sp: ternary = %2d, flags =", inexact);
+ flags_fout (stderr, flags);
MPFR_ASSERTN (0);
}
mpfr_clears (tmpa, tmpb, tmpc, (mpfr_ptr) 0);