diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-09-03 13:02:07 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2019-09-03 13:02:07 +0000 |
commit | 6664154584c64ecfcb188d3abdd73ef3ef5e816d (patch) | |
tree | 7485201f2ab79a35209ae90e3106198dc4dc1e8e /src/add1sp.c | |
parent | 0672352c87c61753e2bac9ad9034eb359ec0cb11 (diff) | |
download | mpfr-6664154584c64ecfcb188d3abdd73ef3ef5e816d.tar.gz |
[src]
* exceptions.c: define flags_fout if MPFR_WANT_ASSERT >= 2, i.e. with
--enable-assert=full (for better flags output in add1sp.c, etc.).
* mpfr-impl.h: declare flags_fout if MPFR_WANT_ASSERT >= 2.
* add1sp.c: improve output of ternary value and flags.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13582 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/add1sp.c')
-rw-r--r-- | src/add1sp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/add1sp.c b/src/add1sp.c index 77ffb6b6f..7a3f4cd1a 100644 --- a/src/add1sp.c +++ b/src/add1sp.c @@ -81,6 +81,10 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) inexact = mpfr_add1sp_ref (a, b, c, rnd_mode); flags = __gmpfr_flags; + /* Convert the ternary values to (-1,0,1). */ + inexact = VSIGN (inexact); + inexact2 = VSIGN (inexact2); + if (! mpfr_equal_p (tmpa, a) || inexact != inexact2 || flags != flags2) { fprintf (stderr, "add1 & add1sp return different values for %s\n" @@ -96,9 +100,10 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mpfr_fdump (stderr, tmpa); fprintf (stderr, "add1sp: "); mpfr_fdump (stderr, a); - fprintf (stderr, "Inexact sp = %d | Inexact = %d\n" - "Flags sp = %u | Flags = %u\n", - inexact, inexact2, flags, flags2); + fprintf (stderr, "add1 : ternary = %2d, flags =", inexact2); + flags_fout (stderr, flags2); + fprintf (stderr, "add1sp: ternary = %2d, flags =", inexact); + flags_fout (stderr, flags); MPFR_ASSERTN (0); } mpfr_clears (tmpa, tmpb, tmpc, (mpfr_ptr) 0); |