Odd or even numbers

Hi

I would like to check if a value is odd or even, does anyone have a good solution for this in RAPID?

I know its possible to divide a value by 2 and count the amount of decimals, but i cannot find a function that can count decimals.

Thank you

Check out “MOD” – IF nYourNumber MOD 2 = 0 THEN

As an extention of Soup his answer, check out this page to understand the mathematics behind the MOD instruction:

It explains fairly well what MOD (A.K.A. Modulo) does.