diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-12-09 10:13:55 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-12-09 10:13:55 +0000 |
commit | fded832d73678419307c2e87e68e8737276b65c4 (patch) | |
tree | b8574f828d53be452df2cce06c7219e001f39b48 /tests/tset_sj.c | |
parent | a824f7ad7bc1fe409778f39947af2914f36f0cb6 (diff) | |
download | mpfr-fded832d73678419307c2e87e68e8737276b65c4.tar.gz |
Optimize mpfr_set4.
Inline rounding in mpfr_set4 and mpfr_cache
mpfr_set4 dosn't return MPFR_EVEN_INEX (It was undocumented before).
Fix problems with tests (Avoid mixing MPFR_EVEN_INEX and 1).
Add MPFR_RNDRAW_EVEN for rounding with MPFR_EVEN_INEX inexact support
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3121 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_sj.c')
-rw-r--r-- | tests/tset_sj.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/tset_sj.c b/tests/tset_sj.c index 000f13f51..8f207988e 100644 --- a/tests/tset_sj.c +++ b/tests/tset_sj.c @@ -50,6 +50,12 @@ int main() { return 0; } #define ERROR(str) {printf("Error for "str"\n"); exit(1);} +static int +inexact_sign (int x) +{ + return (x < 0) ? -1 : (x > 0); +} + static void check_set_uj (mp_prec_t pmin, mp_prec_t pmax, int N) { @@ -78,7 +84,7 @@ check_set_uj (mp_prec_t pmin, mp_prec_t pmax, int N) printf ("Y="); mpfr_dump (y); exit (1); } - if (inex1 != inex2) + if (inexact_sign (inex1) != inexact_sign (inex2)) { printf ("ERROR for inexact(set_uj): j=%lu p=%lu\n" "Inexact1= %d Inexact2= %d\n", |