Diskussion:Leibniz-Reihe
Erscheinungsbild
Java Programm für Kreiszahlberechnung:
import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintWriter; import java.math.BigDecimal; /** * Berechnung der Kreiszahl Pi nach Leibniz Formel. * Gezeigt werden soll, wie langsam man sich Pi naehert wodurch * die Leibniz Formel nicht zur Berechnung von Pi geeignet ist. * * @author Robert Wintner */ public class PiLeibniz { public static void main(String[] args) { FileOutputStream fos = null; try { // Bitte Filenamen bei Bedarf anpassen fos = new FileOutputStream("D:/pileibniz.txt"); } catch (FileNotFoundException e) { e.printStackTrace(); } PrintWriter pw = new PrintWriter(fos); int count = 0; int i = 1; double pi = 3.14159265358979323846; double pi2 = 0; while (count < 1000000000) { pi2 += 1./i; i += 2; pi2 -= 1./i; i += 2; count += 2; double pi3 = pi2*4; double prec = pi3/pi; if (count%1000000 == 0) System.out.println(count); if (count <= 100 || count%1000 == 0) pw.println(count + ": " + pi3 + " " + prec); } pw.close(); } }
Sinn dieses Artikels?
Der Inhalt steht, abgesehen von der Zahlentabelle, bereits in Pi (Kreiszahl), inklusive der mMn zweifelhaften Aussage, Leibniz habe die Konvergenz "bewiesen". Wozu also einen eigenen Artikel (außer als Redirect-Ziel für Leibniz-Reihe)?--Gunther 10:55, 30. Jun 2006 (CEST)