diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2008-09-13 01:43:28 +0000 |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2008-09-13 01:43:28 +0000 |
commit | 2a9b9cbea08c7c22a328926b0e0719fb197743a0 (patch) | |
tree | 51c8930c097a35c97db9cdae6f5af889424cf9bd /Demo/scripts/fact.py | |
parent | e91fcbdf691c687d1195fad342564e0b3442f444 (diff) | |
download | cpython-git-2a9b9cbea08c7c22a328926b0e0719fb197743a0.tar.gz |
#687648 from Robert Schuppenies: use classic division.
Diffstat (limited to 'Demo/scripts/fact.py')
-rwxr-xr-x | Demo/scripts/fact.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Demo/scripts/fact.py b/Demo/scripts/fact.py index 03cab8bb85..6dafa66256 100755 --- a/Demo/scripts/fact.py +++ b/Demo/scripts/fact.py @@ -17,14 +17,14 @@ def fact(n): # Treat even factors special, so we can use i = i+2 later while n%2 == 0: res.append(2) - n = n/2 + n = n//2 # Try odd numbers up to sqrt(n) limit = sqrt(float(n+1)) i = 3 while i <= limit: if n%i == 0: res.append(i) - n = n/i + n = n//i limit = sqrt(n+1) else: i = i+2 |