Notifications
Clear all
[Closed] mod…what is it?
Jun 04, 2003 4:08 am
Hello,
can anybody tell me what this means:
x = 2
y = 5
if mod x y == 0 then
[…]
thank you
2 Replies
Jun 04, 2003 4:08 am
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.