diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-02-08 08:08:27 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-02-08 08:08:27 +0000 |
commit | 21ca2f258539b599eacc782aa19a750af299b2c2 (patch) | |
tree | 143b648abd5be81d89bf4ff10c4e5b190fd96892 /tests | |
parent | 5f1a77e3de3e09714004b7a13aa2f46da756bad4 (diff) | |
download | mpfr-21ca2f258539b599eacc782aa19a750af299b2c2.tar.gz |
[src/jyn_asympt.c] fixed bug when sin(z)+cos(z) or sin(z)-cos(z) round to 0
[tests/tj0.c] added corresponding non-regression test
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14400 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tj0.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tj0.c b/tests/tj0.c index 14e30bf6d..28b2d50cd 100644 --- a/tests/tj0.c +++ b/tests/tj0.c @@ -27,6 +27,23 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define REDUCE_EMAX 262143 /* otherwise arg. reduction is too expensive */ #include "tgeneric.c" +/* bug found in revision 14399 with GMP_CHECK_RANDOMIZE=1612721106588971 */ +static void +bug20210208 (void) +{ + mpfr_t x, y; + int inex; + + mpfr_init2 (x, 79); + mpfr_init2 (y, 1); + mpfr_set_str (x, "2.552495117262005805960565e+02", 10, MPFR_RNDN); + inex = mpfr_j0 (y, x, MPFR_RNDZ); + MPFR_ASSERTN(mpfr_cmp_si_2exp (y, -1, -5) == 0); + MPFR_ASSERTN(inex > 0); + mpfr_clear (x); + mpfr_clear (y); +} + int main (int argc, char *argv[]) { @@ -35,6 +52,8 @@ main (int argc, char *argv[]) tests_start_mpfr (); + bug20210208 (); + mpfr_init (x); mpfr_init (y); |