Maths function 'e'

Previous topic - Next topic

Maxheadroom

Hello,  have two questions: i am trying to work with the 'e' function in math in fact 'e' to the power of, i have had to use the below code is there a easier way?

e=2.71828182845905
max = POW (e,tot)

I can't get more than 10 decimal points is this correct?

MrTAToad

Almost certainly

Maxheadroom

Care to shed some light MrTAToad :whip:

FutureCow

The reason will be because of the C data type used to store the number. I'm not knowledgeable on turning a number of bits into an actual number range but if you're more C datatype oriented than I am, this might help :- from the documentation

QuoteGLBasic's default storage for numbers uses 8 bytes (64 bits).
...
These numbers are otherwise known as "double precision floating-point numbers.

My guess is you've used up all 64 bits in describing that decimal number. Sorry I can't be of more help.

Maxheadroom

Your right, I will have to truncate to 64bit.
Thanks for the help.

Kitty Hello

is there no EXP function?

MrTAToad

No, there isn't...

PI isn't present either  :-[

QuoteCare to shed some light MrTAToad
Gernot would also set a limit on how many characters to display/convert to a string too...