This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Another BigInteger bug.
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Subject: Re: Another BigInteger bug.
- From: Per Bothner <per at bothner dot com>
- Date: Thu, 16 Aug 2001 16:40:13 -0700
- CC: "'java-patches at gcc dot gnu dot org'" <java-patches at gcc dot gnu dot org>
- References: <140D21516EC2D3119EE7009027876644049B5FD9@hplex1.hpl.hp.com>
Boehm, Hans wrote:
>Right shifts of negative numbers by nonzero multiples of 32 generally
>produced the wrong answer. This seems to be yet another case where the code
>assumed that left shifting an int by 32 produced 0.
>
Oops. How about the following instead, which avoids the extra test:
if (neg)
words[d_len-1] |= -2 << (31 - count);