diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-06-25 12:50:21 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-06-25 12:50:21 +0000 |
commit | 3995ccc2ac359a2a66c567b0cc48b0ca987231e7 (patch) | |
tree | 3b27dc661eafea4e607eec2540e61f4ee32f9340 /tests/tset_si.c | |
parent | 4fc658f4c030cdf8550bcf1a308df660ce617aae (diff) | |
download | mpfr-3995ccc2ac359a2a66c567b0cc48b0ca987231e7.tar.gz |
More code clean-up (for both consistency and readability):
* Use the simple mp_limb_t constants when possible.
* New internal macro MPFR_IS_NORMALIZED.
Note: this was done with
perl -pi -e '
s/~ *\(mp_limb_t\) *0/MPFR_LIMB_MAX/g;
s/\(mp_limb_t\) *-1/MPFR_LIMB_MAX/g;
s/\(mp_limb_t\) *0/MPFR_LIMB_ZERO/g;
s/\(mp_limb_t\) *1L?/MPFR_LIMB_ONE/g' {src,tests}/*.{c,h}
svn revert src/mpfr-impl.h
and some manual changes.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9091 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_si.c')
-rw-r--r-- | tests/tset_si.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/tset_si.c b/tests/tset_si.c index 7b8d67b83..170fb109b 100644 --- a/tests/tset_si.c +++ b/tests/tset_si.c @@ -265,8 +265,7 @@ main (int argc, char *argv[]) mpfr_set_prec (x, 3); inex = mpfr_set_si (x, 77617, MPFR_RNDD); /* should be 65536 */ - if (MPFR_MANT(x)[0] != ((mp_limb_t)1 << (mp_bits_per_limb-1)) - || inex >= 0) + if (MPFR_MANT(x)[0] != MPFR_LIMB_HIGHBIT || inex >= 0) { printf ("Error in mpfr_set_si(x:3, 77617, MPFR_RNDD)\n"); mpfr_print_binary (x); @@ -274,8 +273,7 @@ main (int argc, char *argv[]) exit (1); } inex = mpfr_set_ui (x, 77617, MPFR_RNDD); /* should be 65536 */ - if (MPFR_MANT(x)[0] != ((mp_limb_t)1 << (mp_bits_per_limb-1)) - || inex >= 0) + if (MPFR_MANT(x)[0] != MPFR_LIMB_HIGHBIT || inex >= 0) { printf ("Error in mpfr_set_ui(x:3, 77617, MPFR_RNDD)\n"); mpfr_print_binary (x); |