Division operator /
The /
(division) operator yields the
algebraic quotient of its operands. If both operands are integers,
any fractional part (remainder) is discarded. Throwing away the fractional
part is often called truncation toward zero. The operands must
have an arithmetic or enumeration type. The right operand may not
be zero: the result is undefined if the right operand evaluates to 0
.
For example, expression 7 / 4
yields the value 1
(rather
than 1.75
or 2
). The result is not
an lvalue.
If either operand is negative, the result is rounded towards zero.
The usual arithmetic conversions on the operands are performed.