Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, wandaluciaia, 1 invisible), 798 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Higher Index Roots #464019
01/14/17 06:16
01/14/17 06:16
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
I am looking for a way to calculate the root of a number beyond the square root. For instance, how would I calculate the cube-root of a number? Or the fourth root? etc...

I found sqrt(), pow(), exp() and log() in the manual, but none of these seem to do what I'm looking for.

Re: Higher Index Roots [Re: Dooley] #464020
01/14/17 06:38
01/14/17 06:38
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain


Re: Higher Index Roots [Re: txesmi] #464042
01/16/17 16:39
01/16/17 16:39
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The n-th root of a number x can be written as x^(1.0/n), so just put that in the second argument of your pow() function.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Higher Index Roots [Re: Superku] #464074
01/20/17 06:42
01/20/17 06:42
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Thanks guys.
I found this function on another thread and modified it a bit:

Quote:
function Root(var num, var expo)
{
return(exp(log(num)/expo));
}

root_number = Root(2,12);


So, if I plug any two numbers into the Root function it will give me the number that multiplies by itself "expo" times to make "num."

i.e. 1.05946309436 is the twelfth root of two. So if you multiply it by itself 12 times, you get 2. This equation can get this number if you plug in 2 as num and 12 as expo. You could do this with any two numbers.

Higher math is difficult for me, so this is a great forum to have! If anyone can use this equation for something, please go ahead.

Last edited by Dooley; 01/20/17 06:42.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1