How to know if the number is 4,8,12,16----

Cromo
393
Cromo  

Hi, I want to know if the value is 4 ,8,12,16 .... 4 times XXXXX

For example, I have 13.

double N=13;

if (N/4)<point{

Alert("It is 4 times value");

}


Can you help?

Nagisa Unada
820
Nagisa Unada  
if (N % 4 == 0){
   Alert("It is 4 times value");
}
If the remainder of N divided by 4 is 0, then it is a multiple of 4.
Cromo
393
Cromo  

Thank you! but what does this mean?


N % 4 
Nagisa Unada
820
Nagisa Unada  
Cromo:

Thank you! but what does this mean?

% is a arithmetic symbol to find the remainder of the division.

Same as 

MathMod(N, 4)
William Roeder
24704
William Roeder  
Cromo: but what does this mean?

Module division is the remainder from the division (A - int(A/B)*B).

Perhaps you should read the manual. MQL5 ReferenceLanguage BasicsOperations and ExpressionsPrecedence Rules
   How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

Cromo
393
Cromo  
Nagisa Unada:

% is a arithmetic symbol to find the remainder of the division.

Same as 

Wow, I have learned a new code.

Thank you very much!

Cromo
393
Cromo  
William Roeder:

Module division is the remainder from the division (A - int(A/B)*B).

Perhaps you should read the manual. MQL5 ReferenceLanguage BasicsOperations and ExpressionsPrecedence Rules
   How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

Thank you!