diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-07 11:54:53 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-07 11:54:53 +0000 |
commit | 30da9333bb34209ac5754958d81b7473e2a67337 (patch) | |
tree | 96810ec9b79ce1e6899f72ac6d1c5a486a23ca55 /tests/tacosh.c | |
parent | 7b043e368a39a71108ee3d5d80d3ca62bec9579f (diff) | |
download | mpfr-30da9333bb34209ac5754958d81b7473e2a67337.tar.gz |
acosh.c: mentioned bug due to overflow in mpfr_mul.
tests/tacosh.c: added corresponding testcase (for 32-bit machines).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4827 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tacosh.c')
-rw-r--r-- | tests/tacosh.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/tacosh.c b/tests/tacosh.c index e5683ec09..e8cb10aee 100644 --- a/tests/tacosh.c +++ b/tests/tacosh.c @@ -151,6 +151,30 @@ bug20070831 (void) mpfr_clears (x, y, z, (void *) 0); } +static void +huge (void) +{ + mpfr_t x, y, z; + int inex; + + /* TODO: extend the exponent range and use mpfr_get_emax (). */ + mpfr_inits2 (32, x, y, z, (void *) 0); + mpfr_set_ui_2exp (x, 1, 1073741822, GMP_RNDN); + inex = mpfr_acosh (y, x, GMP_RNDN); + mpfr_set_str_binary (z, "0.10110001011100100001011111110101E30"); + if (!mpfr_equal_p (y, z)) + { + printf ("Error in huge:\nexpected "); + mpfr_dump (z); + printf ("got "); + mpfr_dump (y); + exit (1); + } + MPFR_ASSERTN (inex < 0); + + mpfr_clears (x, y, z, (void *) 0); +} + int main (int argc, char *argv[]) { @@ -158,6 +182,7 @@ main (int argc, char *argv[]) special (); bug20070831 (); + huge (); test_generic (2, 100, 25); |