Sujet : Re: Relatively prime integers in NumPy
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.pythonDate : 12. Jul 2024, 03:51:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87sewfml6q.fsf@nightsong.com>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
<
avi.e.gross@gmail.com> writes:
make some list or other data structure for divisors of each number
involved and then use standard methods to compare the lists and exact
common divisors.
You don't need to find divisors (factor the numbers) to find the gcd.
Factorization can be very slow. Gcd on the other hand is very fast,
using the Euclidean GCD algorithm. You should be able to find info
about this easily. Factorization would be a terrible way to compute
gcd's.