This is the mail archive of the
mailing list for the Java project.
Re: Using GMP for BigIntegers.
- To: Per Bothner <per at bothner dot com>
- Subject: Re: Using GMP for BigIntegers.
- From: Warren Levy <warrenl at redhat dot com>
- Date: Mon, 29 Jan 2001 22:34:12 -0800 (PST)
- cc: "Mark J. Roberts" <mjr at statesmean dot com>, java at gcc dot gnu dot org
On 29 Jan 2001, Per Bothner wrote:
> "Mark J. Roberts" <email@example.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
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:
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).