Learn R Programming

pracma (version 1.1.6)

droplet_e: Droplet for e

Description

Generates digits for the Euler number e.

Usage

droplet_e(n)

Arguments

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

Value

  • String containing ``2.718281828..." with n digits after the decimal point.

Details

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

References

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

Examples

Run this code
##  Example
E <- droplet_e(1002)
table(strsplit(substring(E, 3, 1002), ""))
#    0   1   2   3   4   5   6   7   8   9 
#  100  96  97 109 100  85  99  99 103 112

Run the code above in your browser using DataLab