TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: CARLTON WALTERS
from: NEIL HELLER
date: 1998-02-28 08:45:00
subject: WHAT`S HAPPENING

CW> 0111       0000 0000 0000 0111(binary)
CW> Taking the 1's compliment
CW> 1000       1111 1111 1111 1000
When you apply a bit-wise operator to a variable, ALL the bits are
affected (not just the subset of bits which hold your interest).  This
looks correct to me.
CW> why do i get -8 ?
CW> can you explain ?
The left-most bit (bit 0) holds the sign of a number (in this case, an
int).  Flipping it as you did changes the sign from positive (0) to
negative (1).
 * KWQ/2 1.2i *
--- FLAME v1.1
---------------
* Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.