This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: BigInteger.modInverse() fix
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
On Monday 16 December 2002 17:43, Per Bothner wrote:
> Tom Tromey wrote:
> >>>>>>"Per" == Per Bothner <per@bothner.com> writes:
> >
> > Per> Would it make sense to do:
> > Per> rem = rem.canonicalize();
> > Per> quot = quot.canonicalize();
> > Per> It probably doesn't matter.
> >
> > Are rem and quot guaranteed not to be small?...
>
> Not necessarirly. I don't think canonicaliztion of small
> integers is required for correctness, just (space) effiency...
...and speed, for some numerical algorithms where modulo 2**32 is
enough.
> > Per> Instead of allocating a BigInteger at each level of
> > Per> recursion, maybe you could modify euclidInv to:
> >
> > The code already has a FIXME about its inefficient use of memory.
> > So I think making this change isn't a requirement for the patch.
> > OTOH, if Mark or Raif want to do it, that would be great.
see later.
> I didn't mean it as a requirement - only a suggestion.
i'd like to spend sometime over the BigInteger code to see if/how we can
improve its effeciency, and in the process fix the FIXME, etc.
unfortunately it's not gonna be soon --it shouldnt be too long
neither-- since i'd like to stabilise GNU Crypto first.
so... i'll raise my hand for this task, unless somebody else beats me to
it.
cheers;
rsn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Que du magnifique
iD8DBQE9/YjR+e1AKnsTRiERA6kCAJ4sp9DBzyfYxUsD03lUNVLoQuVjpwCfVP+I
6OaI1xAtDwsLwRznLJN/1N8=
=39R3
-----END PGP SIGNATURE-----