Notifications
Clear all

[Closed] mod…what is it?

Hello,

can anybody tell me what this means:

x = 2
y = 5
if mod x y == 0 then
[…]

thank you

2 Replies

mod is short for modulus and is the remainder in a division between two numbers.

So your code fragment will run the code in the if statement if x can be divided by y exactly with no leftover. Note that this is not the same as checking for x == y as x=15 and y=3 would work.

Hello,

thank you!

Best
Sam