diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-09-18 11:46:28 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-09-18 11:46:28 +0000 |
commit | 88d2cc5240368f4dd5b2d6ecf30e2d78a33f5f50 (patch) | |
tree | ccd4928acc57473d917e4c6cd02d452eeb8992f4 /tests/tfrac.c | |
parent | 2e5dad62c3fcc35bf562621479189e653a8d4271 (diff) | |
download | mpfr-88d2cc5240368f4dd5b2d6ecf30e2d78a33f5f50.tar.gz |
tests/tfrac.c: also test the ternary value (it is incorrect too).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6458 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tfrac.c')
-rw-r--r-- | tests/tfrac.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/tfrac.c b/tests/tfrac.c index d7748b302..d81266930 100644 --- a/tests/tfrac.c +++ b/tests/tfrac.c @@ -177,11 +177,12 @@ bug20090918 (void) { mpfr_t x, y; mp_limb_t y0; + int inex; mpfr_init2 (x, 32); mpfr_init2 (y, 13); mpfr_set_str (x, "61680.352935791015625", 10, MPFR_RNDN); - mpfr_frac (y, x, MPFR_RNDZ); + inex = mpfr_frac (y, x, MPFR_RNDZ); y0 = MPFR_MANT(y)[0]; while ((y0 >> 1) << 1 == y0) y0 >>= 1; @@ -190,6 +191,12 @@ bug20090918 (void) printf ("Error in bug20090918 (significand has more than 13 bits).\n"); exit (1); } + if (inex >= 0) + { + printf ("Incorrect ternary value in bug20090918, expected negative," + " got %d.\n", inex); + exit (1); + } mpfr_clear (x); mpfr_clear (y); } |