diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-12-07 10:22:33 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-12-07 10:22:33 +0000 |
commit | e1ae09b3fc06ac8fb0533857121646d0cad37026 (patch) | |
tree | 84c3a887e4fbd6ebfd9fe65531b096a8c44dc2cf | |
parent | 858c9bddc2f4b940f01c3c0abbf9b565883b9a22 (diff) | |
download | mpfr-e1ae09b3fc06ac8fb0533857121646d0cad37026.tar.gz |
tests/tsin_cos.c: in consistency(), fixed flags testing.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6624 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | tests/tsin_cos.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c index 28f6e0736..4e0f7f5db 100644 --- a/tests/tsin_cos.c +++ b/tests/tsin_cos.c @@ -561,7 +561,7 @@ consistency (void) { mpfr_t x, s1, s2, c1, c2; mpfr_rnd_t rnd; - unsigned int flags_sin, flags_cos, flags; + unsigned int flags_sin, flags_cos, flags, flags_before; int inex_sin, is, inex_cos, ic, inex; int i; @@ -572,13 +572,18 @@ consistency (void) (mpfr_ptr) 0); tests_default_random (x, 256, -5, 50); rnd = RND_RAND (); - mpfr_clear_flags (); + flags_before = (randlimb () & 1) ? + (unsigned int) (MPFR_FLAGS_ALL ^ MPFR_FLAGS_ERANGE) : + (unsigned int) 0; + __gmpfr_flags = flags_before; inex_sin = mpfr_sin (s1, x, rnd); is = inex_sin < 0 ? 2 : inex_sin > 0 ? 1 : 0; flags_sin = __gmpfr_flags; + __gmpfr_flags = flags_before; inex_cos = mpfr_cos (c1, x, rnd); ic = inex_cos < 0 ? 2 : inex_cos > 0 ? 1 : 0; flags_cos = __gmpfr_flags; + __gmpfr_flags = flags_before; inex = mpfr_sin_cos (s2, c2, x, rnd); flags = __gmpfr_flags; if (!(mpfr_equal_p (s1, s2) && mpfr_equal_p (c1, c2)) || |