CS 31 (Shinnerl)
Corrections and Clarifications
-
-
- Tues., 1/23/01
It is possible to join two or more expressions
together as a single expression for use as a single operand
to any operator or function expecting a single expression.
See the example
on the comma operator.
- Thurs., 1/25/01
The behavior of a/b and a%b with negative integer
arguments a and b is system dependent: different
platforms may give different answers, when one or more
of the arguments a and b is negative. The answers must
always satisfy the following equation:
a == (a/b)*b + (a%b).
When both a and b are positive, the values of
a/b and a%b
are uniquely determined, because 0 <= a%b < b is required.
But when either a or b is negative,
many systems allow a%b
to be negative, even though the standard mathematical convention
requires the remainder in integer division to be nonnegative
in all cases. See the example
on modulus operator.