For the second power, a*a is a bit shorter than MathPow(a,2), but that's a matter of taste.
double c; c=MathSqrt(a*a+b*b);
If a=b is given then
double c; c=MathSqrt(2.0)*a;
(I'm not really sure that type casting applies to MathSqrt(), but better be safe than sorry. :)
For the second power, a*a is a bit shorter than MathPow(a,2), but that's a matter of taste.
If a=b is given then
(I'm not really sure that type casting applies to MathSqrt(), but better be safe than sorry. :)
hi
thanks for ur help Drave....i will tray this
For the second power, a*a is a bit shorter than MathPow(a,2), but that's a matter of taste.
If a=b is given then
(I'm not really sure that type casting applies to MathSqrt(), but better be safe than sorry. :)
I don't like leaving type-casting in doubt either, just heads-up to save yourself from typing a lot of needless zeroes, all you need to do in order establish that a given value be typecast as a double instead of an integer is to append the decimal marker to it, the zero after the decimal point is not necessary.
double c; c=MathSqrt(2.)*a; // 2. is typecast as a double, the same as typing 2.0 or 2.00 or 2.000
I don't like leaving type-casting in doubt either, just heads-up to save yourself from typing a lot of needless zeroes, all you need to do in order establish that a given value be typecast as a double instead of an integer is to append the decimal marker to it, the zero after the decimal point is not necessary.
hi
sorry for late reply.....but want to thank 1005phillip for his hint..... i appreciate

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi
i want to know how to code for Pythagorean Theorem in mql4
if my equation is =sqrt((a^2)+(b^2))
and a=b
can we do that by using :
any help is appreciated