See several special ones in the http://numbers.computation.free.fr/ConstantsProgram, Only 3-4 rowsCodeBut the square root of the circumference rate, E (bottom of the natural logarithm), log (2), and 2 can be calculated to thousands of bits. Paste them here for your convenience.
Note: All programs in this article come from:
Http://numbers.computation.free.fr/Constants/TinyPrograms/tinycodes.html.
// Calculate the circumference rate of 2400 bits int A = 10000, B, c = 8400, d, e, f [8401], G; Main () {for (; B-c ;) f [B ++] = A/5; For (; D = 0, G = C * 2; C-= 14, printf ("%. 4D ", e + D/A), E = D % A) for (B = C; D + = f [B] *, f [B] = D % -- g, D/= g --, -- B; D * = B);} // calculate the circumference rate of 800 bits. Main () {int A = 1e4, c = 3e3, B = C, D = 0, E = 0, F [3000], G = 1, h = 0; (; B ;! -- B? Printf ("% 04d", e + D/A), E = D % A, H = B = C-= 15: f [B] = (D = D/g * B + A * (H? F [B]: 2e3) % (G = B * 2-1);} // calculate the 1000-bit circumference rate: Long K = 4e3, P, A [337], q, t = 1e3; Main (j) {for (; A [J = q = 0] + = 2, -- k;) for (P = 1 + 2 * K; j <337; q = A [J] * k + q % P * t, a [J ++] = Q/P) K! = J> 2?: Printf ("%. 3D ", a [J-2] % T + q/P/T);} // calculate the base of the 1000-bit natural logarithm: Main () {int n = 9009, N = n, a [9009], X; while (-- N) A [n] = 1 + 1/N; For (; n> 9; printf ("% d", x) for (n = n --; -- N; A [n] = x % N, X = 10 * A [n-1] + x/n);} // calculate the 2400-bit log (2) Main () {int A = 1000, B = 0, C = 7973, d, f [7974], n = 800, K; For (; B <C; F [B ++] = 5); For (; n --; d + = * f * a, printf ("%. 3D ", D/A), * f = D % A) for (D = 0, K = C; -- k; D/= B, D * = K) f [k] = (D + = f [k] * A) % (B = 2 * k + 2);} // calculate the 2400-bit log (2) Main () {int A = 1000, B = 0, c = 2658, D = 75, F [2659], n = 800, K; For (; B <C; f [B ++] = D, D =-d); For (; n --; D + = * f * a, printf ("%. 3D ", D/A), * f = D % A) for (D = 0, K = C; -- k; D/= B, D * = K) f [k] = (D + = f [k] * A) % (B = 8 * k + 4);} // calculate the 2400-bit SQRT (2) Main () {int A = 1000, B = 0, c = 1413, d, f [1414], n = 800, K; For (; B <C; f [B ++] = 14); For (; n --; D + = * f * a, printf ("%. 3D ", D/A), * f = D % A) for (D = 0, K = C; -- k; D/= B, D * = 2 * K-1) f [k] = (D + = f [k] * A) % (B = 100 * k );}