]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/pi.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Demo / scripts / pi.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/pi.py b/AppPkg/Applications/Python/Python-2.7.2/Demo/scripts/pi.py
deleted file mode 100644 (file)
index f46fcff..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /usr/bin/env python\r
-\r
-# Print digits of pi forever.\r
-#\r
-# The algorithm, using Python's 'long' integers ("bignums"), works\r
-# with continued fractions, and was conceived by Lambert Meertens.\r
-#\r
-# See also the ABC Programmer's Handbook, by Geurts, Meertens & Pemberton,\r
-# published by Prentice-Hall (UK) Ltd., 1990.\r
-\r
-import sys\r
-\r
-def main():\r
-    k, a, b, a1, b1 = 2, 4, 1, 12, 4\r
-    while True:\r
-        # Next approximation\r
-        p, q, k = k*k, 2*k+1, k+1\r
-        a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1\r
-        # Print common digits\r
-        d, d1 = a//b, a1//b1\r
-        while d == d1:\r
-            output(d)\r
-            a, a1 = 10*(a%b), 10*(a1%b1)\r
-            d, d1 = a//b, a1//b1\r
-\r
-def output(d):\r
-    # Use write() to avoid spaces between the digits\r
-    sys.stdout.write(str(d))\r
-    # Flush so the output is seen immediately\r
-    sys.stdout.flush()\r
-\r
-if __name__ == "__main__":\r
-    main()\r