This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author snoeberger
Recipients snoeberger
Date 2014-08-20.17:31:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1408555903.78.0.619851425654.issue22238@psf.upfronthosting.co.za>
In-reply-to
Content
>>> import fractions
>>> fractions.gcd(16, float('inf'))
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    fractions.gcd(16, float('inf'))
  File "C:\Python34-32bit\lib\fractions.py", line 24, in gcd
    a, b = b, a%b
KeyboardInterrupt
>>> fractions.gcd(16, float('nan'))
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    fractions.gcd(16, float('nan'))
  File "C:\Python34-32bit\lib\fractions.py", line 24, in gcd
    a, b = b, a%b
KeyboardInterrupt
>>> 

With the iterative algorithm that is used 

a, b = b, a%b

b converges to float('nan'). It will never become 0 to break out of the loop. It might be nice to error when the iteration has converged b to a value other than 0.
History
Date User Action Args
2014-08-20 17:31:43snoebergersetrecipients: + snoeberger
2014-08-20 17:31:43snoebergersetmessageid: <1408555903.78.0.619851425654.issue22238@psf.upfronthosting.co.za>
2014-08-20 17:31:43snoebergerlinkissue22238 messages
2014-08-20 17:31:43snoebergercreate