diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-18 16:17:19 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-18 16:17:19 +0000 |
commit | 2362cd0ade81c2b5778592492ddda5ca0cc3ab54 (patch) | |
tree | 90d5887703f43527b32bd419337e5dad75db13ef /tests | |
parent | 1fc92eea3c19f3199610d85b5c0abf598882e919 (diff) | |
download | mpfr-2362cd0ade81c2b5778592492ddda5ca0cc3ab54.tar.gz |
[src/mul.c] with Mulders', convert RNDF to RNDZ
[tests/tmul_d.c] added a non-regression test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12005 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tmul_d.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/tmul_d.c b/tests/tmul_d.c index d29976146..42787b014 100644 --- a/tests/tmul_d.c +++ b/tests/tmul_d.c @@ -70,6 +70,24 @@ check_nans (void) mpfr_clear (y); } +static void +bug20171218 (void) +{ + mpfr_t a, b; + mpfr_init2 (a, 22); + mpfr_init2 (b, 1312); + mpfr_set_str (b, "1.ffffffffffffffffffc3e0007ffe000700fff8001fff800000000007e0fffe0007fffffff00001f800000003ffffffe1fc00000003fffe7c03ffffffffffffffe000000fffffffff83f0000007ffc03ffffffffc0007ff0000ffcfffffe00000f80000000003c007ffffffff3ff807ffffffffff000000000000001fc000fffe000600000ff0003ffe00fffffffc00001ffc0fffffffffff00000807fe03ffffffc01ffe", 16, MPFR_RNDN); + mpfr_mul_d (a, b, 0.5, MPFR_RNDF); + /* a should be 1 or nextbelow(1) */ + if (mpfr_cmp_ui (a, 1) != 0) + { + mpfr_nextabove (a); + MPFR_ASSERTN(mpfr_cmp_ui (a, 1) == 0); + } + mpfr_clear (a); + mpfr_clear (b); +} + #define TEST_FUNCTION mpfr_mul_d #define DOUBLE_ARG2 #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), 1, RANDS) @@ -84,6 +102,8 @@ main (void) tests_start_mpfr (); + bug20171218 (); + /* check with enough precision */ mpfr_init2 (x, IEEE_DBL_MANT_DIG); mpfr_init2 (y, IEEE_DBL_MANT_DIG); |