diff options
author | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-28 12:08:56 +0000 |
---|---|---|
committer | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-28 12:08:56 +0000 |
commit | 8900f49d074b0d50b4e666861c9ffcc1499818cd (patch) | |
tree | e715099a110e70ee02d6334dc392cd7e3f1ae244 /tests/tfmod.c | |
parent | 78efdd4d6471836c64bf6deb8037196f00fde8af (diff) | |
download | mpfr-8900f49d074b0d50b4e666861c9ffcc1499818cd.tar.gz |
merge fmod, remaider and remquo into a single file rem1.c.
merge code into a single internal function mpfr_rem1.
fix false statement in mpfr.texi: rop and op1 have the same sign for mpfr_fmod
but not for mpfr_remainder and mpfr_remquo.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4869 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tfmod.c')
-rw-r--r-- | tests/tfmod.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/tfmod.c b/tests/tfmod.c index a030fc8ff..8b115d5cf 100644 --- a/tests/tfmod.c +++ b/tests/tfmod.c @@ -71,7 +71,7 @@ test_failed (mpfr_t erem, mpfr_t grem, mpfr_t x, mpfr_t y, mp_rnd_t rnd) mpfr_out_str (stderr, 10, 0, x, GMP_RNDD); fprintf (stderr, "\n y = "); mpfr_out_str (stderr, 10, 0, y, GMP_RNDD); - fprintf (stderr, "rnd = %s\n", mpfr_print_rnd_mode (rnd)); + fprintf (stderr, "\nrnd = %s\n", mpfr_print_rnd_mode (rnd)); fprintf (stderr, "\n expected r = "); mpfr_out_str (stderr, 10, 0, erem, GMP_RNDD); fprintf (stderr, "\n got r = "); @@ -180,13 +180,18 @@ main (int argc, char *argv[]) mpfr_mul_d (x, y, .12345, GMP_RNDN); check (r, x, y, GMP_RNDN); - /* huge differences between precisions */ - mpfr_set_prec (x, 2048); + /* sign(x) = sign (r) */ + mpfr_set_str (x, "123798", 10, GMP_RNDN); + mpfr_set_str (y, "10", 10, GMP_RNDN); + check (r, x, y, GMP_RNDN); + + /* huge difference between precisions */ + mpfr_set_prec (x, 314); mpfr_const_pi (x, GMP_RNDD); /* x = pi */ mpfr_set_prec (y, 8); mpfr_set_ui (y, 1, GMP_RNDD); mpfr_div_2ui (y, y, 3, GMP_RNDD); /* y = 1/8 */ - mpfr_set_prec (r, 250); + mpfr_set_prec (r, 123); check (r, x, y, GMP_RNDD); mpfr_clears (x, y, r, (void *)0); |