summaryrefslogtreecommitdiff
path: root/tests/tmul_2exp.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-13 14:50:26 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>2000-12-13 14:50:26 +0000
commitcc340e50eca22701c92b9ef0922f92e6c14c683b (patch)
treedc7f85507eaf62aada115064d50aedf1e290eca8 /tests/tmul_2exp.c
parent3035f62d87667e08ac5370bca1e47fe8f683c2e8 (diff)
downloadmpfr-cc340e50eca22701c92b9ef0922f92e6c14c683b.tar.gz
Take into account Inf, Nans ; clear the flags of the return variable
in most function calls. Tests updated accordingly git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@852 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tmul_2exp.c')
-rw-r--r--tests/tmul_2exp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c
index 890c51e42..f00f3d3a1 100644
--- a/tests/tmul_2exp.c
+++ b/tests/tmul_2exp.c
@@ -35,6 +35,14 @@ main(argc,argv) int argc; char *argv[];
mpfr_init2(w, 53);
+ mpfr_set_d(w, 1.0/0.0, 0);
+ mpfr_mul_2exp(w, w, 10, GMP_RNDZ);
+ if (!MPFR_IS_INF(w)) { fprintf(stderr, "Inf != Inf"); exit(-1); }
+
+ mpfr_set_d(w, 0.0/0.0, 0);
+ mpfr_mul_2exp(w, w, 10, GMP_RNDZ);
+ if (!MPFR_IS_NAN(w)) { fprintf(stderr, "NaN != NaN"); exit(-1); }
+
for (k = 0; k < 100000; k++) {
srand48(time(NULL));
x = drand48();
@@ -56,6 +64,8 @@ main(argc,argv) int argc; char *argv[];
}
}
+
+
mpfr_clear(w);
return (0);
}