diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-05 11:52:06 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-09-05 11:52:06 +0000 |
commit | 5309fb1ee65a0a43c5dc9712bad69f836f08f458 (patch) | |
tree | 13eb789c1179ac9ba5720bbc25b4c8ec7c20dae9 | |
parent | c392960862797ed81b3da39422614e763577b337 (diff) | |
download | mpfr-5309fb1ee65a0a43c5dc9712bad69f836f08f458.tar.gz |
[src/get_ld.c] In the case GMP_NUMB_BITS == 16, cast to unsigned long
instead of unsigned int since shift counts can be up to 16 and an int
might be on 16 bits only.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13137 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/get_ld.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/get_ld.c b/src/get_ld.c index 1717d33c9..c98d6bf40 100644 --- a/src/get_ld.c +++ b/src/get_ld.c @@ -97,29 +97,29 @@ mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode) #elif GMP_NUMB_BITS == 16 if (MPFR_LIKELY (denorm == 0)) { - ld.s.manl = tmpmant[0] | ((unsigned int) tmpmant[1] << 16); - ld.s.manh = tmpmant[2] | ((unsigned int) tmpmant[3] << 16); + ld.s.manl = tmpmant[0] | ((unsigned long) tmpmant[1] << 16); + ld.s.manh = tmpmant[2] | ((unsigned long) tmpmant[3] << 16); } else if (denorm < 16) { ld.s.manl = (tmpmant[0] >> denorm) - | ((unsigned int) tmpmant[1] << (16 - denorm)) - | ((unsigned int) tmpmant[2] << (32 - denorm)); + | ((unsigned long) tmpmant[1] << (16 - denorm)) + | ((unsigned long) tmpmant[2] << (32 - denorm)); ld.s.manh = (tmpmant[2] >> denorm) - | ((unsigned int) tmpmant[3] << (16 - denorm)); + | ((unsigned long) tmpmant[3] << (16 - denorm)); } else if (denorm < 32) { ld.s.manl = (tmpmant[1] >> (denorm - 16)) - | ((unsigned int) tmpmant[2] << (32 - denorm)); + | ((unsigned long) tmpmant[2] << (32 - denorm)); if (denorm < 16) - ld.s.manl |= ((unsigned int) tmpmant[3] << (48 - denorm)); + ld.s.manl |= ((unsigned long) tmpmant[3] << (48 - denorm)); ld.s.manh = tmpmant[3] >> (denorm - 16); } else if (denorm < 48) { ld.s.manl = (tmpmant[2] >> (denorm - 32)) - | ((unsigned int) tmpmant[3] << (64 - denorm)); + | ((unsigned long) tmpmant[3] << (64 - denorm)); ld.s.manh = 0; } else /* 48 <= denorm < 64 */ |