Square & cubic root

 
Hi,

With
MathSqrt function I cand get the square root.
But how can I get the cubic root or another root? Is it possible in mql4?

Thanks'
iancu
 
iancu:
But how can I get the cubic root or another root? Is it possible in mql4?

MathPow(number, 1/root). For example, MathPow(8, 1.0/3.0)) = 2. MathPow(number, 0.5) is the same as MathSqrt(number).

The only thing to watch out for is that MathPow(8, 1/3) does not work correctly. It needs to be MathPow(8, 1.0/3.0). MQL interprets 1/3 as the division of one integer by another, leading to the value zero. It then does 8^0 = 1. Specifying the numbers as 1.0 and 3.0 tells MQL to interpret them as doubles, not integers.


Reason: