Euclid's Algorithm in Python?

jepler at unpythonic.net jepler at unpythonic.net
Fri Aug 5 12:36:31 EDT 2005


On Thu, Aug 04, 2005 at 08:13:11PM -0700, Jordan Rastrick wrote:
> Raising an assertion error for a < b is a bit of overkill, since its
> not really a case of bad input. So normally you see Euclid done like
> this:
[snipped]

My point was not so much that this was the ultimate implementation of GCD, but
that the obvious search would have turned up many enlightening results,
including the topmost one.

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050805/f6092772/attachment.sig>


More information about the Python-list mailing list