Darwinbots Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New Installer for Dawinbots 2 Released.
Home
Help
Search
Members
View the memberlist
Search For Members
Login
Register
Darwinbots Forum
»
Code center
»
Darwinbots Program Source Code
(Moderators:
Numsgil
,
EricL
) »
Confused
« previous
next »
Print
Pages: [
1
]
Author
Topic: Confused (Read 4793 times)
Ulciscor
Bot Destroyer
Posts: 401
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:
Logged
Ulciscor
I used to be indecisive, but now I'm not so sure.
Numsgil
Administrator
Bot God
Posts: 7742
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.
Logged
Ulciscor
Bot Destroyer
Posts: 401
Confused
«
Reply #2 on:
June 26, 2005, 04:49:45 PM »
Look at the first bit of this
Mod
Logged
Ulciscor
I used to be indecisive, but now I'm not so sure.
Numsgil
Administrator
Bot God
Posts: 7742
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).
Logged
Zelos
Bot Overlord
Posts: 707
Confused
«
Reply #4 on:
October 15, 2005, 02:22:01 PM »
I dont get it, what does mod do?
Logged
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
AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA
Ulciscor
Bot Destroyer
Posts: 401
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.
Logged
Ulciscor
I used to be indecisive, but now I'm not so sure.
Old Henk
Bot Destroyer
Posts: 229
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.
Logged
Numsgil
Administrator
Bot God
Posts: 7742
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).
Logged
Print
Pages: [
1
]
« previous
next »
Darwinbots Forum
»
Code center
»
Darwinbots Program Source Code
(Moderators:
Numsgil
,
EricL
) »
Confused