PDA

View Full Version : mod...what is it?


Katachi
06-04-2003, 03:08 AM
Hello,

can anybody tell me what this means:

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

thank you

Baldrick
06-04-2003, 03:19 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.

Katachi
06-04-2003, 09:38 AM
Hello,

thank you!

Best
Sam

CGTalk Moderation
01-15-2006, 07:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.