Shift by negative quantity

Chris Torek chris at umcp-cs.UUCP
Sun Jul 6 03:24:45 AEST 1986


In article <894 at bu-cs.UUCP> bzs at bu-cs.UUCP (Barry Shein) writes:
>Question: Is shifting by a negative quantity defined (that is,
>probably means the other shift.) I could find no mention in K&R.

It is explicitly undefined.  K&R, Appendix A, \S 7.5, Shift Operators
(p. 189):

  The result is undefined if the right operand is negative, or greater
  than or equal to the length of the object in bits.

>P.S. Is this one of those questions that gets asked every 2 months?

No.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.lang.c mailing list