GLBasic forum

Main forum => GLBasic - en => Topic started by: AMateus on 2011-Oct-04

Title: EXP()
Post by: AMateus on 2011-Oct-04
Hi,

Is there a way to calculate EXP(number) in GLBasic? I don't seem to find it in the manual. Is it implemented?

I have tried inline but give me errors on compile (not surprised here cause I'm not a C fellow =P).

Code (glbasic) Select

// Beginning of the module
INLINE

#include <math.h>
ENDINLINE


// and then the function
FUNCTION Exponential#: value#

INLINE

return exp (value);

ENDINLINE

ENDFUNCTION


When compiling the error is:
Code (glbasic) Select

C:\Users\ANTNIO~1\AppData\Local\Temp\glbasic\gpc_tempg.cpp: In member function `DGInt __GLBASIC__::tMath::Exponential(DGInt)':
C:\Users\ANTNIO~1\AppData\Local\Temp\glbasic\gpc_tempg.cpp:218: error: `exp' was not declared in this scope


Thanks,
António
Title: Re: EXP()
Post by: backslider on 2011-Oct-04
Do you mean the Function
Code (glbasic) Select

LOCAL i = POW(10, 5)

?
Title: Re: EXP()
Post by: Kitty Hello on 2011-Oct-04
POW(2.71828183, x)
Title: Re: EXP()
Post by: AMateus on 2011-Oct-04
oh ok thanks... my math sucks lol xD