summaryrefslogtreecommitdiff
path: root/tests/tsub.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2001-05-23 16:57:20 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2001-05-23 16:57:20 +0000
commit0c0fec1be24c97066f0ca3f624cd1bc7a8e9cda2 (patch)
tree34c69847d868004681245ee9a3d2f4c867e73790 /tests/tsub.c
parent66132d7a33910816ed461500a943d91ca5b38920 (diff)
downloadmpfr-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.c27
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()
{