
Envoyé par
n1256
6.5.5 Multiplicative operators
Syntax
...
Constraints
2 Each of the operands shall have arithmetic type. The operands of the % operator shall have integer type.
Semantics
3 The usual arithmetic conversions are performed on the operands.
...
5 The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder. In both operations, if the value of the second operand is zero, the behavior is undefined.
6 When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded.90) If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a.
...
90) This is often called ‘‘truncation toward zero’’.
Partager