Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / math functions

Author
Message
Hippie Dude
20
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 4th Nov 2005 03:41
Some questions of math code:

how can you do a square root?

how do you do an exponent?


thanks in advanced!

Mysteries Surround You
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 4th Nov 2005 06:16 Edited at: 4th Nov 2005 06:16
Hippie Dude,

Get a sqare root by using the sqrt command.

eg:


Exponents are almost created like scientifically, using the ^ symbol.

eg:


...which is 3 to the 5th power.



+NanoBrain+
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Nov 2005 11:11
Just additional information:

When using ^-1, use 1/ instead.



This test runs the math equations a 100 000 times and then displays the time in milliseconds. On my pc, a = 5 ^ -1 is 50ms and 1/5 is 37ms.

Time is...fps?

Immunity and Annihalation makes Immunihalation...
Hippie Dude
20
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 4th Nov 2005 16:26
Thanks alot!

Mysteries Surround You

Login to post a reply

Server time is: 2025-05-22 13:22:55
Your offset time is: 2025-05-22 13:22:55