[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in Long.toOctalString

From: Tom Tromey
Subject: Re: Bug in Long.toOctalString
Date: 20 Jul 2001 23:18:15 -0600

>>>>> "Eric" == Eric Blake <address@hidden> writes:

Eric> My version was more or less from Integer.toUnsignedString,
Eric> except that I calculated the mask once instead of in the loop
Eric> (which means the version in Integer can be optimized, too).

This is done in the libgcj version.

Eric> Also, (int)l & mask is more efficient than (int)(l & mask), as
Eric> the VM then does not have to expand mask to a long, perform 64
Eric> bit math, and chop it back down.


Eric> I also noticed that the compareTo methods in both Long and
Eric> Integer have a bug - subtraction only produces a valid result if
Eric> the answer doesn't overflow.

See the libgcj version.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]