From: Guido van Rossum Date: Mon, 30 Mar 1992 11:15:49 +0000 (+0000) Subject: small fixes X-Git-Tag: v0.9.8~424 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a585bb964483f2892f5a7bfc8e899806a1dc247;p=thirdparty%2FPython%2Fcpython.git small fixes --- diff --git a/Demo/scripts/fact.py b/Demo/scripts/fact.py index b406086819d0..4833e0892d0a 100755 --- a/Demo/scripts/fact.py +++ b/Demo/scripts/fact.py @@ -19,7 +19,7 @@ def fact(n): res.append(2) n = n/2 # Try odd numbers up to sqrt(n) - limit = sqrt(n+1) + limit = sqrt(float(n+1)) i = 3 while i <= limit: if n%i == 0: @@ -28,7 +28,8 @@ def fact(n): limit = sqrt(n+1) else: i = i+2 - res.append(n) + if n != 1: + res.append(n) return res def main():