diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-06-04 10:50:42 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-06-04 10:50:42 +0000 |
commit | 260e4b4603c8b706961c8d0dbc9e9be5e1c4747d (patch) | |
tree | c189e356b56745a2fdf73cc29915b9cdee8efa55 /tests/tdiv.c | |
parent | eb17692ef76ea9b3a6e0b32854e1783e5c5d1894 (diff) | |
download | mpfr-260e4b4603c8b706961c8d0dbc9e9be5e1c4747d.tar.gz |
tdiv.c: added test from Carl Witty's bug report on 2007-06-03.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4528 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tdiv.c')
-rw-r--r-- | tests/tdiv.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/tdiv.c b/tests/tdiv.c index 1cb50842d..edd84342b 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -778,6 +778,33 @@ consistency (void) mpfr_clears (x, y, z1, z2, (void *) 0); } +/* Reported by Carl Witty on 2007-06-03 */ +static void +test_20070603 (void) +{ + mpfr_t n, d, q, c; + + mpfr_init2 (n, 128); + mpfr_init2 (d, 128); + mpfr_init2 (q, 31); + mpfr_init2 (c, 31); + + mpfr_set_str (n, "10384593717069655257060992206846485", 10, GMP_RNDN); + mpfr_set_str (d, "10384593717069655257060992206847132", 10, GMP_RNDN); + mpfr_div (q, n, d, GMP_RNDU); + + mpfr_set_ui (c, 1, GMP_RNDN); + mpfr_nextabove (c); + if (mpfr_cmp (q, c) != 0) + { + printf ("Error in test_20070603\nGot "); + mpfr_dump (q); + printf ("instead of "); + mpfr_dump (c); + exit (1); + } +} + #define TEST_FUNCTION test_div #define TWO_ARGS #define RAND_FUNCTION(x) mpfr_random2(x, MPFR_LIMB_SIZE (x), randlimb () % 100) @@ -807,6 +834,7 @@ main (int argc, char *argv[]) "0.11010011111001101011111001100111110100000001101001111100111000000E-1119"); consistency (); + test_20070603 (); test_generic (2, 800, 50); tests_end_mpfr (); |