diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-10-25 13:39:35 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-10-25 13:39:35 +0000 |
commit | 94bd84c58126962bcbcd1a8613672dfb1d775476 (patch) | |
tree | 0bedf85046fb3130c0c3c0e88bfb713df71c3eee /tests/tui_sub.c | |
parent | fc3867a55d10a8fea8bc51c5748fef5f9082b1f0 (diff) | |
download | mpfr-94bd84c58126962bcbcd1a8613672dfb1d775476.tar.gz |
added two tests
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1355 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tui_sub.c')
-rw-r--r-- | tests/tui_sub.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tui_sub.c b/tests/tui_sub.c index 49e6bfded..0f5312f66 100644 --- a/tests/tui_sub.c +++ b/tests/tui_sub.c @@ -42,6 +42,25 @@ special () mpfr_init (y); mpfr_init (res); + mpfr_set_prec (x, 24); + mpfr_set_prec (y, 24); + mpfr_set_str_raw (y, "0.111100110001011010111"); + inexact = mpfr_ui_sub (x, 1, y, GMP_RNDN); + if (inexact) + { + fprintf (stderr, "Wrong inexact flag: got %d, expected 0\n", inexact); + exit (1); + } + + mpfr_set_prec (x, 24); + mpfr_set_prec (y, 24); + mpfr_set_str_raw (y, "0.111100110001011010111"); + if ((inexact = mpfr_ui_sub (x, 38181761, y, GMP_RNDN)) >= 0) + { + fprintf (stderr, "Wrong inexact flag: got %d, expected -1\n", inexact); + exit (1); + } + mpfr_set_prec (x, 63); mpfr_set_prec (y, 63); mpfr_set_str_raw (y, "0.111110010010100100110101101010001001100101110001000101110111111E-1"); |