Ok
Now i know :D
Examples:
int i = 1 / 2; // no types casting, the result is 0 int i = 1 / 2.0; // the expression is cast to the double type, then is to the target type of int, the result is 0 double d = 1.0 / 2.0; // no types casting, the result is 0.5 double d = 1 / 2.0; // the expression is cast to the double type that is the same as the target type, the result is 0.5 double d = 1 / 2; // the expression of the int type is cast to the target type of double, the result is 0.0 string s = 1.0 / 8; // the expression is cast to the double type, then is to the target type of string, the result is "0.12500000" (the string containing 10 characters) string s = NULL; // the constant of type int is cast to the target type of string, the result is "0" (the string containing 1 character) string s = "Ticket #"+12345; // the expression is cast to the string type that is the same as the target type, the result is "Ticket #12
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a simply code.
when put on the chart, it give me wrong result.
Why?
When i test with 0.12345, its work!
//factor=0.12345;