mpz_trial_div
Paul Leyland
pleyland@microsoft.com
Thu, 14 Nov 2002 07:58:38 -0800
> From: Torbjorn Granlund [mailto:tege@swox.com]=20
> "Paul Leyland" <pleyland@microsoft.com> writes:
>=20
> > Possible , although I think it is unneccessairy (as we have=20
> > the mpz fn mpz_remove_ui) , consider
> >=20
> > d=3Dmpz_trial_div(N,1,10000);
> > m=3Dmpz_remove_ui(N,N,d);
> >=20
> > to cover the multiplicity case
> =20
> Fair point. Thanks.
>=20
> Not sure that would work. Assume our number has the factor 3^2*5.
> mpz_trial_div might find 3*5 and return that. mpz_remove_ui
> would then typically leave one factor 3.
>=20
> Since some usages of mpz_trial_div will only care if any factor is
> found, we don't want to slow it down by having it figure out any
> factor multiplicity.
I thought we'd agreed, wrongly it appears, that mpz_trial_div would =
return only prime factors and would always return the smallest such =
(perhaps in the range start--end if those arguments are present).
Paul