MQL4 Reference
Math & Trig
MathSqrt
| double MathSqrt( |
double x) |
The MathSqrt function returns the square root of x.
If x is negative, MathSqrt returns an indefinite (same as a quiet NaN).
Parameters:
| x |
- |
Positive numeric value. |
Sample:
double question=45.35, answer;
answer=MathSqrt(question);
if(question<0)
Print("Error: MathSqrt returns ",answer," answer");
else
Print("The square root of ",question," is ", answer);
//Output: The square root of 45.35 is 6.73
|
|
|