diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-13 14:50:26 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-12-13 14:50:26 +0000 |
commit | cc340e50eca22701c92b9ef0922f92e6c14c683b (patch) | |
tree | dc7f85507eaf62aada115064d50aedf1e290eca8 /tests/tmul_2exp.c | |
parent | 3035f62d87667e08ac5370bca1e47fe8f683c2e8 (diff) | |
download | mpfr-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.c | 10 |
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); } |