diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-05-23 16:57:20 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-05-23 16:57:20 +0000 |
commit | 0c0fec1be24c97066f0ca3f624cd1bc7a8e9cda2 (patch) | |
tree | 34c69847d868004681245ee9a3d2f4c867e73790 /tests/tsub.c | |
parent | 66132d7a33910816ed461500a943d91ca5b38920 (diff) | |
download | mpfr-0c0fec1be24c97066f0ca3f624cd1bc7a8e9cda2.tar.gz |
Added DDefour's bug.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1086 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsub.c')
-rw-r--r-- | tests/tsub.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/tsub.c b/tests/tsub.c index b9782f30f..c64e71d2a 100644 --- a/tests/tsub.c +++ b/tests/tsub.c @@ -63,6 +63,33 @@ check_reuse () mpfr_clear (y); } +void +bug_ddefour() +{ + mpfr_t ex, ex1, ex2, ex3, tot, tot1; + + mpfr_init2(ex, 53); + mpfr_init2(ex1, 53); + mpfr_init2(ex2, 53); + mpfr_init2(ex3, 53); + mpfr_init2(tot, 150); + mpfr_init2(tot1, 150); + + mpfr_set_ui( ex, 1, GMP_RNDN); + mpfr_mul_2exp( ex, ex, 906, GMP_RNDN); + mpfr_log( tot, ex, GMP_RNDN); + mpfr_set( ex1, tot, GMP_RNDN); + mpfr_sub( ex2, tot, ex1, GMP_RNDN); + mpfr_sub( tot1, tot, ex1, GMP_RNDN); + mpfr_set( ex3, tot1, GMP_RNDN); + + if (!mpfr_cmp(ex2, ex3)) + { + fprintf(stderr, "Error in ddefour test.\n"); exit(-1); + } +} + + int main() { |