This is the mail archive of the java@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: Using GMP for BigIntegers.


On 29 Jan 2001, Per Bothner wrote:

> "Mark J. Roberts" <mjr@statesmean.com> writes:
> 
> > So, is GMP in your future?
> 
> Yes and no...

Per, thanks for describing the plan.  

For the benefit of all, let me just add that though this is what we want
to do, it isn't actively being worked on here at Red Hat.  We are spending
some time looking at TODO type things and this will certainly be on the
list.  No promises though schedule-wise.

> One thing that really sucks with BigInteger is all the extra fields
> that were added for Serialization.  We do want the serialization
> format to match Sun's, but having duplicate fields is really bad.
> The implementations of readObject and writeObject should be
> fixed.

Yes, this is a bummer.  When I implemented this it was the most expedient
way to get it working, but IIRC when I tried to do it via calls to 
writeInt directly (rather than using defaultWriteObject), I had problems
with serialized object compatibility with the JDK.  If you (or anyone) has
ideas on this area, please pass them along as this can certainly be
revisited if there's a better, compatible approach.

> We would also be interested in a details about the bug you found.

I suspect that Mark is referring to the bug he reported and I narrowed
down to something in the private divide method of BigInteger:

	http://gcc.gnu.org/ml/java/2001-01/msg00165.html

The bug requires specific input to cause the bug (i.e. the remainder was
being calculated as a negative value even though the divisor and dividend
were both positive).
--warrenl


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