diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-17 15:16:48 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-17 15:16:48 +0000 |
commit | 53573c762974dc7d43fd466d07d2cb55651d175f (patch) | |
tree | 819e4ec5cbadeec76b3563e7ffbf8ff9cc5cb222 | |
parent | 7fd94e86e925a213ee1a4e99867eb1562a203c99 (diff) | |
download | mpfr-53573c762974dc7d43fd466d07d2cb55651d175f.tar.gz |
[tests/tadd1sp.c] added test for new bug (still to be fixed):
Seed GMP_CHECK_RANDOMIZE=1514385177 (include this in bug reports)
add1 & add1sp return different values for MPFR_RNDN
Prec_a = 137, Prec_b = 137, Prec_c = 137
B = 0.11111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000E-66
C = 0.11111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000110000E-2
add1 : 0.10000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000001000E-1
add1sp: 0.11111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000010000E-2
Inexact sp = 0 | Inexact = 0
Flags sp = 8 | Flags = 8
add1sp.c:89: MPFR assertion failed: 0
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11986 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | tests/tadd1sp.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c index eda82bb41..62aa42a34 100644 --- a/tests/tadd1sp.c +++ b/tests/tadd1sp.c @@ -54,6 +54,24 @@ check_overflow (void) set_emax (emax); } +static void +bug20171217 (void) +{ + mpfr_t a, b, c; + + mpfr_init2 (a, 137); + mpfr_init2 (b, 137); + mpfr_init2 (c, 137); + mpfr_set_str_binary (b, "0.11111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000E-66"); + mpfr_set_str_binary (c, "0.11111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000110000E-2"); + mpfr_add (a, b, c, MPFR_RNDN); + mpfr_set_str_binary (b, "0.10000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000001000E-1"); + MPFR_ASSERTN(mpfr_equal_p (a, b)); + mpfr_clear (a); + mpfr_clear (b); + mpfr_clear (c); +} + int main (void) { @@ -61,6 +79,7 @@ main (void) tests_start_mpfr (); + bug20171217 (); check_special (); for(p = MPFR_PREC_MIN; p < 200 ; p++) check_random (p); |