diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-16 17:57:38 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-16 17:57:38 +0000 |
commit | 78ddd7e74f1654c2b6fb7f6185ab9d469671084e (patch) | |
tree | a580450c1947b2d6ddc047cfea7901b616110d02 /tests/tadd.c | |
parent | fca91fddbe88724349badfb6f5fa9f0556872220 (diff) | |
download | mpfr-78ddd7e74f1654c2b6fb7f6185ab9d469671084e.tar.gz |
Added more tests (improved tadd1.c coverage).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2738 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tadd.c')
-rw-r--r-- | tests/tadd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/tadd.c b/tests/tadd.c index 151d67159..b2a72e3d4 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -19,7 +19,7 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define N 20000 +#define N 30000 #include <stdio.h> #include <stdlib.h> @@ -648,7 +648,8 @@ check_1111 (void) mp_prec_t prec_a, prec_b, prec_c; mp_exp_t tb, tc, diff; mpfr_t a, b, c, s; - int m = 256; + int m = 512; + int sb, sc; int inex_a, inex_s; mp_rnd_t rnd_mode; @@ -661,8 +662,14 @@ check_1111 (void) tb = 1 + (randlimb () % (prec_b - 1)); tc = 1 + (randlimb () % (prec_c - 1)); mpfr_div_2ui (b, one, tb, GMP_RNDN); + sb = randlimb () % 2; + if (sb) + mpfr_neg (b, b, GMP_RNDN); mpfr_add (b, b, one, GMP_RNDN); mpfr_div_2ui (c, one, tc, GMP_RNDN); + sc = randlimb () % 2; + if (sc) + mpfr_neg (c, c, GMP_RNDN); mpfr_add (c, c, one, GMP_RNDN); diff = (randlimb () % (2*m)) - m; mpfr_mul_2ui (c, c, diff, GMP_RNDN); @@ -687,6 +694,7 @@ check_1111 (void) printf ("tb = %d, tc = %d, diff = %d, rnd = %s\n", (int) tb, (int) tc, (int) diff, mpfr_print_rnd_mode (rnd_mode)); + printf ("sb = %d, sc = %d\n", sb, sc); printf ("a = "); mpfr_print_binary (a); puts (""); printf ("s = "); mpfr_print_binary (s); puts (""); printf ("inex_a = %d, inex_s = %d\n", inex_a, inex_s); |