Learn R Programming

numbers (version 0.8-5)

dropletPi: Droplet Algorithm for pi and e

Description

Generates digits for pi resp. the Euler number e.

Usage

dropletPi(n)
dropletE(n)

Value

String containing ``3.1415926..." resp. ``2.718281828..." with

n digits after the decimal point (i.e., internal decimal places).

Arguments

n

number of digits after the decimal point; should not exceed 1000 much as otherwise it will be very slow.

Details

Based on a formula discovered by S. Rabinowitz and S. Wagon.

The droplet algorithm for pi uses the Euler transform of the alternating Leibniz series and the so-called ``radix conversion".

References

Borwein, J., and K. Devlin (2009). The Computer as Crucible: An Introduction to Experimental Mathematics. A K Peters, Ltd.

Arndt, J., and Ch. Haenel (2000). Pi -- Algorithmen, Computer, Arithmetik. Springer-Verlag, Berlin Heidelberg.