summaryrefslogtreecommitdiffstats
path: root/Demo/scripts/pi.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-10 21:10:05 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-10 21:10:05 (GMT)
commit69f81a8b686c1e05df6cb077bea185ba4918b5ac (patch)
treefbcbdf32f224e5f45cf2b7fec57ec9b4f7bc330b /Demo/scripts/pi.py
parent18cb94980786dddd7703ee640e9473e63de0acc3 (diff)
downloadcpython-69f81a8b686c1e05df6cb077bea185ba4918b5ac.zip
cpython-69f81a8b686c1e05df6cb077bea185ba4918b5ac.tar.gz
cpython-69f81a8b686c1e05df6cb077bea185ba4918b5ac.tar.bz2
Remove unneeded "L" suffixes.
Diffstat (limited to 'Demo/scripts/pi.py')
-rwxr-xr-xDemo/scripts/pi.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Demo/scripts/pi.py b/Demo/scripts/pi.py
index e6e3b82..0740cd0 100755
--- a/Demo/scripts/pi.py
+++ b/Demo/scripts/pi.py
@@ -11,21 +11,20 @@
import sys
def main():
- k, a, b, a1, b1 = 2L, 4L, 1L, 12L, 4L
- while 1:
+ k, a, b, a1, b1 = 2, 4, 1, 12, 4
+ while True:
# Next approximation
- p, q, k = k*k, 2L*k+1L, k+1L
+ p, q, k = k*k, 2*k+1, k+1
a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1
# Print common digits
d, d1 = a//b, a1//b1
while d == d1:
output(d)
- a, a1 = 10L*(a%b), 10L*(a1%b1)
+ a, a1 = 10*(a%b), 10*(a1%b1)
d, d1 = a//b, a1//b1
def output(d):
# Use write() to avoid spaces between the digits
- # Use str() to avoid the 'L'
sys.stdout.write(str(d))
# Flush so the output is seen immediately
sys.stdout.flush()