This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: BigInteger(byte[]) constructor bugfix.
- To: <java at gcc dot gnu dot org>
- Subject: Re: BigInteger(byte[]) constructor bugfix.
- From: "Mark J. Roberts" <mjr at statesmean dot com>
- Date: Sun, 1 Apr 2001 01:28:47 -0500 (EST)
On Sun, 1 Apr 2001, Mark J. Roberts wrote:
> private static int[] byteArrayToIntArray(byte[] bytes, int sign)
> {
> // Determine number of words needed.
> int[] words = new int[(bytes.length + 3) / 4 + 1];
> int nwords = words.length;
>
> // For simplicity, tack on an extra word of sign at the front,
> // it will be canonicalized out later. */
> if ((bytes.length % 4) != 0) words[--nwords] = sign;
Err, sorry -- the above inserted if statement was our first fix for this
problem, but later the whole line seemed superfluous. My bad.
--
Satan, oscillate my metallic sonatas!
Mark Roberts | mjr@statesmean.com