Download MetaTrader 5
To add comments, please log in or register
Any problems with the code? Find solution in documentation!
foongshen
12
foongshen 2013.11.21 14:27 

hi, as below is a simple code i had create. But y output will be zero ? it suppose be 87.5

int int_lower_shadow = 70;
int int_upper_shadow = 81;

Print(((int_lower_shadow / int_upper_shadow) * 100));

Thanks

Simon Gniadkowski
Moderator
17994
Simon Gniadkowski 2013.11.21 14:37  
foongshen:

hi, as below is a simple code i had create. But y output will be zero ? it suppose be 87.5

Thanks

Because int_lower_shadow / int_upper_shadow is less than 1 and an int of less than 1 is 0

Read this: Type Casting

/
To add comments, please log in or register