On Thu, Aug 30, 2012 at 2:07 PM, Peter Otten <__pete...@web.de> wrote: > > Allowing floats for a primality test is a can of worms anyway. You will > inevitably run out of significant digits:
Allowing floats can also lead to type errors for operations that require an integral type, but at least they're easier to catch with proper testing. For example, line 323 will raise a TypeError if n is a float: http://code.google.com/p/pyprimes/source/browse/src/pyprimes.py#323 1.0 == 1, but range(1.0) is not allowed and neither is [0,1][1.0]. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor