Can anybody remember how the natural base "e" or 2.7... is obtained. If i remember correctly it is the sum of an infinite series...perhaps geometric. Yah i know its a math question but it does pertain to a programming thing i'm working on. The actual series formula would be a great help.

Posted on 2002-05-03 22:16:25 by titan
straight from google, maybe it's of some assistance
Posted on 2002-05-03 22:22:00 by Hiroshimator

That explains what e is in some detail, including a formula on how to approximate it.
Posted on 2002-05-03 23:11:54 by _js_
You wanted the series ..

According to a book of mine ( Real and complex analysis, Walter Rudin ) the number e is defined as shown in the attached picture.

( it's actually defined as the exponential function with argument 1, exp(1) ).

Hope it helps.

Posted on 2002-05-04 07:01:56 by Flyke

You can use FPUs internal functions to get e (Neper's Number) by the equation: e=2^[1/ln(2)] (^ means powered).
I wrote the code below to do this. The function f2xm1 deserve special attention because it only accept numbers between -1.0 to +1.0 (and subtract 1 from result). For this reason I used a half part of 1/ln(2) and corrected the values at the next step.

.model flat,stdcall
option casemap:none

include \masm615\include\
include \masm615\include\
include \masm615\include\

includelib \masm615\lib\user32.lib
includelib \masm615\lib\kernel32.lib
includelib \masm615\lib\masm32.lib

hApp DWORD 0
qwNeper QWORD 0.0
qwTwo QWORD 2.0

Buffer24 BYTE 24 DUP (0)
szMsg BYTE 256 DUP (0)


invoke GetModuleHandle,0
mov hApp,eax

fld1 ;ST(0)=1
fldln2 ;ST(0)=ln(2) = 0.693
fdiv ;ST(0)=1/ln(2) = 1.443
fdiv qwTwo ;ST(0)=0.5/ln(2) = 0.721
f2xm1 ;ST(0)={2^[0.5/ln(2)]}-1 = 0.649
fld1 ;ST(0)=1
fadd ;ST(0)=2^[0.5/ln(2)] = 1.649
fld ST(0) ;ST(0)=2^[0.5/ln(2)]
fmul ;ST(0)=2^[1/ln(2)] = 2.718
fstp qwNeper ;neper=e STACK CLEANED

invoke FloatToStr, qwNeper, ADDR Buffer24
invoke szCatStr,ADDR szMsg,ADDR Buffer24
invoke StdOut, ADDR szMsg

invoke ExitProcess,eax

End Start

Good luck.
Posted on 2002-05-06 17:51:37 by wolfao