small fixes

This commit is contained in:
Guido van Rossum 1992-03-30 11:15:49 +00:00
parent 9a6757dade
commit 3a585bb964
1 changed files with 3 additions and 2 deletions

View File

@ -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():