• R/O
  • SSH

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A small kernel of code for playing with Galois fields of arbitrary characteristic


Commit MetaInfo

Revision0b77fa2db6fa3a13e8db4381e43d20e076ae3cfd (tree)
Time2020-01-13 07:45:56
AuthorEric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Turning this into a grab-bag of math stuff.

Change Summary

Incremental Difference

diff -r 8afc24c8f8d1 -r 0b77fa2db6fa ratpi.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ratpi.py Sun Jan 12 14:45:56 2020 -0800
@@ -0,0 +1,8 @@
1+from fractions import Fraction as F
2+
3+"""I have no better place to put this. This is a quickly converging series for
4+computing a rational approximation of pi. For when you want more precision
5+than math.pi will give you."""
6+
7+def ratpi(n):
8+ return sum(F(1/16**k)*(F(4,8*k+1) - F(2,8*k + 4) - F(1,8*k+5) - F(1, 8*k+6)) for k in range(0, n))