diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-25 21:50:34 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-25 21:50:34 (GMT) |
commit | 6d27f27fe64178257962cf3fa9cab61b03cbcc51 (patch) | |
tree | c8909ef172c239ac052863e6cb5f450c68465f4b /generic/tclStrToD.c | |
parent | aaf56c80863b3c12efb020dd21eaa440be153968 (diff) | |
download | tcl-6d27f27fe64178257962cf3fa9cab61b03cbcc51.zip tcl-6d27f27fe64178257962cf3fa9cab61b03cbcc51.tar.gz tcl-6d27f27fe64178257962cf3fa9cab61b03cbcc51.tar.bz2 |
Eliminate all usage of mp_iszero/mp_iseven/mp_isodd/mp_isneg from libtommath: In the upcoming new version those will become real functions, causing possible binary incompatibility. This change makes Tcl independant from libtommath's changes.
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r-- | generic/tclStrToD.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 5d601e4..6257409 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -3162,7 +3162,7 @@ ShouldBankerRoundUpPowD( int isodd) /* 1 if the digit is odd, 0 if even. */ { int i; - static const mp_digit topbit = 1 << (DIGIT_BIT - 1); + static const mp_digit topbit = ((mp_digit)1) << (DIGIT_BIT - 1); if (b->used < sd || (b->dp[sd-1] & topbit) == 0) { return 0; @@ -4631,7 +4631,7 @@ TclBignumToDouble( */ mp_div_2d(a, -shift, &b, NULL); - if (mp_isodd(&b)) { + if (mp_get_bit(&b, 0)) { if (b.sign == MP_ZPOS) { mp_add_d(&b, 1, &b); } else { @@ -4720,7 +4720,7 @@ TclCeil( mp_int d; mp_init(&d); mp_div_2d(a, -shift, &b, &d); - exact = mp_iszero(&d); + exact = d.used == 0; mp_clear(&d); } else { mp_copy(a, &b); |