## e

Another irrational number. Moreover it's transcendental! Available in expr as exp(1).

base of natural logarithms; useful since d/dx(e^x) = e^x.

And Integral(1/x) = ln(x) Integral(1/x) from 1 to e is ln(e) = 1.

2.718281828459... (see http://mathworld.wolfram.com/e.html ) Note it does not recur, despite repeating 1828 twice in the first 10 digits.

A spigot algorithm for calculating e from http://www1.physik.tu-muenchen.de/~gammel/matpack/html/Mathematics/Pi.html

See also Sample Math Programs which also has a spigot algorithm for e and Pi (a spigot for Pi).

The C source is:

``` int main(void){
int a,b=3301,*c=a,d,e,f;
for(e=b; --e; *c++=1)
;
*c=2;
for(d=2001; d--; printf("%05d",f))
for(c=a, e=b; e; f/=e--){
f += *c * 1e5;
*c++ = f%e;
}
}```

translated into Tcl:

```   proc calce {} {
list a
set b 3301;        set c 0; set f 0

for {set e [expr \$b-1]} {\$e>0} {incr e -1} {  lappend a 1 } ;# fill array with 1 for(e=b;--e;*c++=1);
lappend a 2 ;#*c=2;
puts "Should be e =\n2.71828182845904523536028747135266249775724709369995... "
for {set d 2001} {\$d>0 } {puts -nonewline [format "%.5i" [expr int(\$f)] ] ; update } { ;#for(d=2001;d--;printf("%05d",f))
incr d -1
for {set c 0; set e \$b} {\$e>0} {flush stdout} {;# for(c=a,e=b;e;f/=e--){f+=*c*1e5;*c++=f%e;}
set f [expr int(\$f + [lindex \$a \$c]*100000)]  ;#f+=*c*1e5;
lset a \$c [expr round(fmod(\$f,\$e))];# *c = f%e
incr c ;# c++
set f [expr int(\$f/\$e)] ;# f/=e
incr e -1 ;#e--
}
}
}
calce```

GWM 10.11.04 I have added an 'update' in the above for use with wish where the console is not updated due to the -nonewline option on puts - to see the spigot pouring numbers it is necessary to have an update.

2004-11-10 VI Also the name of the http://www.erights.org/elang/ language. Also the basis of verisity's hardware design verification tools. For want of a better link: http://www.verisity.com/partners/licensee/index.html

Also the logo for Eolas.

 Category Mathematics