summaryrefslogtreecommitdiff
path: root/tests/tmul_2exp.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2003-09-25 08:15:42 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2003-09-25 08:15:42 +0000
commitfd5e5221f3d42f1d1e29d99a15ac43a76460bf9b (patch)
tree332aef339e58cafd2dc32ee33efc6e2cbb66852a /tests/tmul_2exp.c
parent788b255e420f8d4ba0f0b43ce87b00b62d60a896 (diff)
downloadmpfr-fd5e5221f3d42f1d1e29d99a15ac43a76460bf9b.tar.gz
Changed the remaining stderr to stdout.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2449 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tmul_2exp.c')
-rw-r--r--tests/tmul_2exp.c63
1 files changed, 36 insertions, 27 deletions
diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c
index b2a2b071f..751978ae4 100644
--- a/tests/tmul_2exp.c
+++ b/tests/tmul_2exp.c
@@ -34,39 +34,48 @@ MA 02111-1307, USA. */
int
main (int argc, char *argv[])
{
- double x, z; mpfr_t w; unsigned long k;
+ double x, z; mpfr_t w; unsigned long k;
tests_start_mpfr ();
- mpfr_init2(w, 53);
+ mpfr_init2(w, 53);
mpfr_set_inf (w, 1);
- mpfr_mul_2exp (w, w, 10, GMP_RNDZ);
- if (!MPFR_IS_INF(w)) { fprintf(stderr, "Inf != Inf"); exit(-1); }
-
+ mpfr_mul_2exp (w, w, 10, GMP_RNDZ);
+ if (!MPFR_IS_INF(w))
+ {
+ printf ("Inf != Inf");
+ exit (1);
+ }
+
mpfr_set_nan (w);
- 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++) {
- x = DBL_RAND ();
- mpfr_set_d (w, x, 0);
- mpfr_mul_2exp (w, w, 10, GMP_RNDZ);
- if (x != (z = mpfr_get_d1 (w)/1024))
- {
- fprintf(stderr, "%f != %f\n", x, z);
- return -1;
- }
-
- mpfr_set_d(w, x, 0);
- mpfr_div_2exp(w, w, 10, GMP_RNDZ);
- if (x != (z = mpfr_get_d1 (w)*1024))
- {
- fprintf(stderr, "%f != %f\n", x, z);
- mpfr_clear(w);
- return -1;
- }
- }
+ mpfr_mul_2exp (w, w, 10, GMP_RNDZ);
+ if (!MPFR_IS_NAN(w))
+ {
+ printf ("NaN != NaN");
+ exit (1);
+ }
+
+ for (k = 0; k < 100000; k++)
+ {
+ x = DBL_RAND ();
+ mpfr_set_d (w, x, 0);
+ mpfr_mul_2exp (w, w, 10, GMP_RNDZ);
+ if (x != (z = mpfr_get_d1 (w)/1024))
+ {
+ printf ("%f != %f\n", x, z);
+ exit (1);
+ }
+
+ mpfr_set_d(w, x, 0);
+ mpfr_div_2exp(w, w, 10, GMP_RNDZ);
+ if (x != (z = mpfr_get_d1 (w)*1024))
+ {
+ printf ("%f != %f\n", x, z);
+ mpfr_clear (w);
+ exit (1);
+ }
+ }
mpfr_clear(w);