Code center > Darwinbots Program Source Code

Confused

(1/2) > >>

Ulciscor:
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:

Numsgil:
I think |X| is absolute value.

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

Ulciscor:
Look at the first bit of this

Mod

Numsgil:
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).

Zelos:
I dont get it, what does mod do?

Navigation

[0] Message Index

[#] Next page

Go to full version