6.5.5 Multiplicative operators

Previous Table of Contents "New C Standard" commentary

1143

multiplicative-expression:
                cast-expression
                multiplicative-expression * cast-expression
                multiplicative-expression / cast-expression
                multiplicative-expression % cast-expression 

1144 Each of the operands shall have arithmetic type.

1145 The operands of the % operator shall have integer type.

1146 The usual arithmetic conversions are performed on the operands.

1147 The result of the binary * operator is the product of the operands.

1148 The result of the / operator is the quotient from the division of the first operand by the second;

1149 the result of the % operator is the remainder.

1150 In both operations, if the value of the second operand is zero, the behavior is undefined.

1151 When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded.88)

1152 If the quotient a/b is representable, the expression (a/b)*b + a%b shall equal a.

Next

Created at: 2008-01-30 02:39:42 The text from WG14/N1256 is copyright © ISO