summaryrefslogtreecommitdiff
path: root/Build/source/libs/mpfr/mpfr-src/src/get_sj.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-02-01 05:18:31 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-02-01 05:18:31 +0000
commit75f5fef5e39387f0d6053f8b6906eaf1e262a83c (patch)
treed96dd8ac4683089ee03d79f6bebc4226cb2dfe8e /Build/source/libs/mpfr/mpfr-src/src/get_sj.c
parent8c783dfd1ce0ee550e0dbb6ae6658b350b97978c (diff)
mpfr-4.0.2
git-svn-id: svn://tug.org/texlive/trunk@49895 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/get_sj.c')
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_sj.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_sj.c b/Build/source/libs/mpfr/mpfr-src/src/get_sj.c
index 41715892618..2e217787ca4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_sj.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_sj.c
@@ -1,6 +1,6 @@
/* mpfr_get_sj -- convert a MPFR number to a huge machine signed integer
-Copyright 2004, 2006-2018 Free Software Foundation, Inc.
+Copyright 2004, 2006-2019 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -17,7 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
@@ -90,7 +90,7 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd)
(even though xp[n] == 0 in such a case). This can happen if
sizeof(mp_limb_t) < sizeof(intmax_t) and |x| is small enough
because of the trailing bits due to its normalization. */
- for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0 && sh >= 0; n--)
+ for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0 && sh > 0; n--)
{
sh -= GMP_NUMB_BITS;
/* Note the concerning the casts below:
@@ -100,7 +100,7 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd)
for the case sizeof(intmax_t) == sizeof(mp_limb_t), as
mp_limb_t is unsigned, therefore not representable as an
intmax_t when the MSB is 1 (this is the case here). */
- MPFR_ASSERTD (sh < GMP_NUMB_BITS && -sh < GMP_NUMB_BITS);
+ MPFR_ASSERTD (-sh < GMP_NUMB_BITS);
r += (sh >= 0
? (intmax_t) xp[n] << sh
: (intmax_t) (xp[n] >> (-sh)));
@@ -109,10 +109,10 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd)
else
{
/* See the comments for the case x positive. */
- for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0 && sh >= 0; n--)
+ for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0 && sh > 0; n--)
{
sh -= GMP_NUMB_BITS;
- MPFR_ASSERTD (sh < GMP_NUMB_BITS && -sh < GMP_NUMB_BITS);
+ MPFR_ASSERTD (-sh < GMP_NUMB_BITS);
r -= (sh >= 0
? (intmax_t) xp[n] << sh
: (intmax_t) (xp[n] >> (-sh)));