diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-05-02 22:46:56 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-05-02 22:46:56 +0000 |
commit | 3240cf2db845490d8ede711a0e41bebfd29d90e0 (patch) | |
tree | b09858d6c43f96bd45e029d0f6332be946dabc94 /tests/thypot.c | |
parent | f2f98e606a2f603ae38ab3fff2bae442c96e2c7d (diff) | |
download | mpfr-3240cf2db845490d8ede711a0e41bebfd29d90e0.tar.gz |
Added a test showing a bug, enabled when TEST_LARGE_SMALL is defined
(to avoid a freeze with make check).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3511 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/thypot.c')
-rw-r--r-- | tests/thypot.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/thypot.c b/tests/thypot.c index 0fa4982f1..5ccc75cbd 100644 --- a/tests/thypot.c +++ b/tests/thypot.c @@ -106,6 +106,24 @@ test_large (void) mpfr_clear (t); } +static void +test_large_small (void) +{ + mpfr_t x, y, z; + + mpfr_init2 (x, 3); + mpfr_init2 (y, 2); + mpfr_init2 (z, 2); + + mpfr_set_ui_2exp (x, 1, mpfr_get_emax () / 2, GMP_RNDN); + mpfr_set_ui_2exp (y, 1, -1, GMP_RNDN); + mpfr_hypot (z, x, y, GMP_RNDN); + + mpfr_clear (x); + mpfr_clear (y); + mpfr_clear (z); +} + int main (int argc, char *argv[]) { @@ -205,6 +223,10 @@ main (int argc, char *argv[]) test_large (); +#ifdef TEST_LARGE_SMALL + test_large_small (); +#endif + tests_end_mpfr (); return 0; } |