Detecting whether a number is divisible by 3

 

Hi,


I am trying to get my SQL code to detect whether value x is divisible by three


e.g.


6/3 == true


12/3 == true


16/3 == false


20/3 == false


How do I do this in mql4 language please? I've search the documentation but can't find anything


Thankyou for your help

James

 

if(MathMod(NumberToCheck,3)==0) Print(NumberToCheck+" is a multiple of 3");

the Mod function is avaiable in every serious programming language....

 
meikel:

if(MathMod(NumberToCheck,3)==0) Print(Number+" is a multiple of 3");

the Mod function is avaiable in every serious programming language....

Thankyou so much for you quick reply, have a good evening

 
Does not % work?
Reason: