TITLE: Is integer division uniquely defined in mathematics?
QUESTION [7 upvotes]: I am currently studying java programming and am a bit shaken up by the concept of integer division. I guess it is just a matter of getting used to that $1/2=0$, but I am afraid it might take some time, given that this property of the division operator (/) is inconsistent with mathematics.
Or is it? Reading the section in Wikipedia on division of integers seems to imply that it is an ambiguous concept (see the following link). The statement that the set of integers is not closed under division (i.e. integer division might produce elements that are not integers) makes sense to me, as does option 2 in the following list. The list puzzles me, however. Its existence implies that we have a choice in the matter, and that one of them (option 4) permits you to call "$1/2=0$" a true statement.
So, is the meaning of integer division really just a matter of taste? Can "$1/2=0$" be a true statement, even in a strict mathematical sense, depending on how you interpret it?

REPLY [3 votes]: As others have mentioned, mathematical notation is heavily overloaded where one symbol can be used for several, potentially incompatible, notions.  The correct notion is (usually) given or can be inferred from context, at least to the level of detail needed. Programming languages exacerbate this problem.
Ultimately, you can have any symbol mean anything as long as you provide a definition.  That said, integer division isn't an ad-hoc contrivance, though it is arguably incorrectly implemented in most programming languages.  Taking Shaun's "essential property" of division, we can weaken it to another property that completely characterizes integer division.  Let $b$ be a positive integer, and $a$ and $c$ any integers.  Then the following property (a Galois connection or adjunction) characterizes integer division:
$$\textrm{forall }a \textrm{ and } c\quad a\times{}b \leq c\quad \textrm{if and only if}\quad a \leq c/b$$
Note that this is equivalent also to
$$\textrm{forall }a \textrm{ and } c\quad a\times{}b \gt c\quad \textrm{if and only if}\quad a \gt c/b$$
So what should $5/3$ be?  If we say $0$, then we'd have forall $a$, $a \gt 5/3 = 0$ implies $a\times{}3 \gt 5$ which is not true for $a=1$.  If we say $2$, then we'd have forall $a$, $a \leq 5/3 = 2$ implies $a\times{}3 \leq 5$ which is not true for $a=2$.  $a=1$ does satisfy the property.  More interesting, work out what $(-5)/3$ should be and compare it to your favorite programming language.