This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Another BigInteger bug.


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);




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]