[Edu-sig] Long Integer Fractions

Kirby Urner pdx4d@teleport.com
Thu, 18 May 2000 10:46:18 -0700


>(on the lines of "well, I believe in writing doc strings, but 
>heh, you already *knew* this was called "gcd" - what did you 
>*think* it did?" - that is, recognising the function *name* 
>rather than the algorithm...)

Yeah, that's a good explanation.

I don't think the algorithm itself merits a "duh", even 
though it's simple to code.  Still working on a paragraph
to make it more intuitively obvious.

My earlier edition of primes.py relied on having prime 
factorizations of a,b in order to get their gcd. 

Given prime factorizations are difficult to come by, my 
gcd method was inherently inefficient, though still 
useful from a pedagogical point of view (for students 
learning about primes, the concepts vs. the need for 
efficiency in computing).

I've kept my old approach as the method 'incommon', but
substituted Euclid's gcd() as per this thread -- already
had an lcm() based on gcd().

Kirby