Most integer operations can result in overflow if the resulting value cannot be represented by the underlying representation of the integer.
Operator | Overflow |
---|---|
+ | yes |
- | yes |
* | yes |
/ | yes |
% | yes |
++ | yes |
- | yes |
= | no |
+= | yes |
-= | yes |
*= | yes |
/= | yes |
%= | yes |
<< | yes |
>>= | yes |
&= | no |
\= | no |
^= | no |
<< | yes |
>> | yes |
& | no |
| | no |
^ | no |
~ | no |
! | no |
un + | no |
un - | yes |
< | no |
> | no |
>= | no |
<= | no |
== | no |
!= | no |
&& | no |
|| | no |
?: | no |
Addition
Addition in C is between two operands of arithmetic type, or between a pointer to an object type and an integer type. (Incrementing is equivalent to adding one.)
...