bit patterns of all ones
Joseph S. D. Yao
jsdy at hadron.UUCP
Fri Jan 2 22:31:56 AEST 1987
In article <595 at mrstve.UUCP> rjk at mrstve.UUCP (Richard Kuhns) writes:
>I don't understand. On a ones-complement machine, -1 is represented by
>11111110(binary) = -1 (decimal, ones complement, signed)
>If the ... value above is cast to unsigned, we end up with 254(decimal).
Casts convert. "The value is the least unsigned integer congruent
to the signed integer (modulo 2^wordsize)." -C REF 6.5, Unsigned.
Casts do not necessarily maintain the same bit pattern.
[inews placater]
--
Joe Yao hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}
jsdy at hadron.COM (not yet domainised)
More information about the Comp.lang.c
mailing list