Results 1 to 15 of 15

Thread: mod?

  1. #1
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default mod?

    Don't hate me :P. I have searched for ever and then give up and forget about it. I was just wondering what "mod" is used for? What does it do and mean?

  2. #2
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    I might be totally wrong but :

    M.O.D = Merchants Of Death
    mod = modify (abridged)...

    Can you specify where you found it ?

  3. #3
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    The modulus operator gives you the remainder of one number divided by another.
    :-)

  4. #4
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so your saying its just used to devide a number by another number?

  5. #5
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    It does exactly what I said: it returns the remainder of one number divided by another.
    :-)

  6. #6
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here's an example:

    SCAR Code:
    Program New;

    Begin
      WriteLN(IntToSTr(12 Mod 10));
    End.

    Returns 2.

    ~Sandstorm

  7. #7
    Join Date
    Jul 2008
    Posts
    907
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    eg 5 mod 2=1


  8. #8
    Join Date
    Jul 2007
    Location
    Missouri
    Posts
    318
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok, thanks, i get it now :P i appreciate all the help.

  9. #9
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    12 mod 13 = 12?

  10. #10
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    1,330
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    12 mod 13 = 12?
    Heh. I never used it in reverse. However i would suspect so :P

    FYI. Most people use mod to do know when to switch loads as you can do it every 2 loads or whatever by making sure ..

    players[currentplayer].integer[0] mod loads = 0

  11. #11
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    12 mod 13 = 12?
    Yup, 12 mod 13 does in fact return 12.

  12. #12
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how though? (12 mod 13)

  13. #13
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I woulda thought it would return -1. :/.

    ~Sandstorm

  14. #14
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    how though? (12 mod 13)
    Simple. 13 divides evenly into 12 exactly 0 times. 12 is then left as the remainder.

  15. #15
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh yeah.. forgot about the remainder..

    thanks ^^

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •