Author Topic: Confused  (Read 4790 times)

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Confused
« on: June 26, 2005, 03:17:22 PM »
I just realised...
in school we got taught that |X| is said as 'mod X' and returns the absolute value of X, I.e. it's magnitude.
But then there is Xmod2 which is the remainder when X is divided by 2.

Or have I just totally made up the |X| bit? I might have dreamt it or something I am not sure.

 :unsure:
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Confused
« Reply #1 on: June 26, 2005, 04:15:25 PM »
I think |X| is absolute value.

modulus is number mod number I think, or number % number in programming.

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Confused
« Reply #2 on: June 26, 2005, 04:49:45 PM »
Look at the first bit of this

Mod
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Confused
« Reply #3 on: June 26, 2005, 05:43:38 PM »
Okay, there are actually two conecpts.

Modulus is the absolute value.
Modulo is the remainder of integer division (and has some other definitions as well that are similar).

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Confused
« Reply #4 on: October 15, 2005, 02:22:01 PM »
I dont get it, what does mod do?
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Confused
« Reply #5 on: October 15, 2005, 02:30:14 PM »
As I said, 4mod2 is the remainder when 4 is divided by 2. This is modulo. Modulus is the absoloute value, the magnitude of a number regardeless of sign. Mod is probably used most commonly as the first definition.
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Old Henk

  • Bot Destroyer
  • ***
  • Posts: 229
    • View Profile
Confused
« Reply #6 on: October 15, 2005, 02:38:20 PM »
So, for example:

4mod2 = 0 (4/2 is exactly 2; there's no remainder)
3mod2 = 1 (3/2 leaves one remainder)
10mod6 = 4

etc.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Confused
« Reply #7 on: October 15, 2005, 02:39:58 PM »
Definition of mod:

a (mod n) = b means that:

n*q + b = a where b < n, b >= 0, and q is some integer.

That's the math definition anyway, I think computer mods allow for b to be < 0 (that is, just the remainder of integer division).