summaryrefslogtreecommitdiff
path: root/tests/tset_si.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tset_si.c')
-rw-r--r--tests/tset_si.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/tset_si.c b/tests/tset_si.c
index 9f4771283..e08366ce0 100644
--- a/tests/tset_si.c
+++ b/tests/tset_si.c
@@ -1,6 +1,6 @@
/* Test file for mpfr_set_si and mpfr_set_ui.
-Copyright 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+Copyright 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the MPFR Library.
@@ -72,7 +72,7 @@ main (int argc, char *argv[])
long k, z, d, N;
unsigned long zl, dl;
int inex;
- mp_rnd_t r;
+ int r;
mp_exp_t emax;
tests_start_mpfr ();
@@ -167,40 +167,40 @@ main (int argc, char *argv[])
exit (1);
}
- for(r = 0 ; r < GMP_RND_MAX ; r++)
+ for (r = 0 ; r < GMP_RND_MAX ; r++)
{
- mpfr_set_si (x, -1, r);
- mpfr_set_ui (x, 0, r);
+ mpfr_set_si (x, -1, (mp_rnd_t) r);
+ mpfr_set_ui (x, 0, (mp_rnd_t) r);
if (MPFR_IS_NEG (x) )
{
printf ("mpfr_set_ui (x, 0) gives -0 for %s\n",
- mpfr_print_rnd_mode(r));
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
- mpfr_set_si (x, -1, r);
- mpfr_set_si (x, 0, r);
- if (MPFR_IS_NEG (x) )
+ mpfr_set_si (x, -1, (mp_rnd_t) r);
+ mpfr_set_si (x, 0, (mp_rnd_t) r);
+ if (MPFR_IS_NEG (x))
{
printf ("mpfr_set_si (x, 0) gives -0 for %s\n",
- mpfr_print_rnd_mode(r) );
+ mpfr_print_rnd_mode ((mp_rnd_t) r));
exit (1);
}
}
/* check potential bug in case mp_limb_t is unsigned */
emax = mpfr_get_emax ();
- mpfr_set_emax (0);
+ set_emax (0);
mpfr_set_si (x, -1, GMP_RNDN);
if (mpfr_sgn (x) >= 0)
{
printf ("mpfr_set_si (x, -1) fails\n");
exit (1);
}
- mpfr_set_emax (emax);
+ set_emax (emax);
emax = mpfr_get_emax ();
- mpfr_set_emax (5);
+ set_emax (5);
mpfr_set_prec (x, 2);
mpfr_set_si (x, -31, GMP_RNDN);
if (mpfr_sgn (x) >= 0)
@@ -208,7 +208,7 @@ main (int argc, char *argv[])
printf ("mpfr_set_si (x, -31) fails\n");
exit (1);
}
- mpfr_set_emax (emax);
+ set_emax (emax);
/* test for get_ui */
mpfr_set_ui (x, 0, GMP_RNDN);
@@ -244,13 +244,13 @@ main (int argc, char *argv[])
mpfr_set_ui (x, 7, GMP_RNDU);
MPFR_ASSERTN(mpfr_cmp_ui (x, 8) == 0);
emax = mpfr_get_emax ();
- mpfr_set_emax (3);
+ set_emax (3);
mpfr_set_ui (x, 7, GMP_RNDU);
MPFR_ASSERTN(mpfr_inf_p (x) && mpfr_sgn (x) > 0);
- mpfr_set_emax (1);
+ set_emax (1);
MPFR_ASSERTN( mpfr_set_ui (x, 7, GMP_RNDU) );
MPFR_ASSERTN(mpfr_inf_p (x) && mpfr_sgn (x) > 0);
- mpfr_set_emax (emax);
+ set_emax (emax);
/* Test for ERANGE flag + correct behaviour if overflow */
mpfr_set_prec (x, 256);