Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

bitwise operator

 Decimal         Binary           2's complement 
   0            00000000           -(11111111+1) = -00000000 = -0(decimal)
   1            00000001           -(11111110+1) = -11111111 = -256(decimal)
   12           00001100           -(11110011+1) = -11110100 = -244(decimal)
   220          11011100           -(00100011+1) = -00100100 = -36(decimal)

Note: Overflow is ignored while computing 2's complement.
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #bitwise #operator
ADD COMMENT
Topic
Name
9+1 =