Code: Select all
#E = 2.71828182
Procedure.f Exp(value.f)
ProcedureReturn Pow(#E, value)
EndProcedure
Code: Select all
#E = 2.71828182
Procedure.f Exp(value.f)
ProcedureReturn Pow(#E, value)
EndProcedure
IMO there should be just one Abs() which can (or the compiler can) determine whether it is a float or integer.- Abs() for integers, best way two functions: Abs() & AbsF()
chris319 wrote:As for other requests, we should be able to use a variable after Step in a For...Next loop. Requiring the use of a constant is ridiculous. And preferably not StepW and StepF, just Step.
No idea. http://no.php.net/expKillswitch wrote:I'm a little confused - what does Exp() actually return (obviously value^#E) but whats it for/do?
If you lack some skills for math understanding, it's no big deal...Killswitch wrote:I'm a little confused - what does Exp() actually return (obviously value^#E) but whats it for/do?
Code: Select all
Procedure.f Exp(x.f)
Protected r.f, t.f, i.f
If x >= 0
r = 1.0
t = 1.0
While t
i + 1.0
t * x / i
r + t
Wend
Else
r = 1/Exp(-x)
EndIf
ProcedureReturn r
EndProcedure
x.f = 0.485714
y.f = 1.421053
Debug StrF(Pow(x, y), 17)
Debug StrF(Exp(y*Log(x)), 17)