Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.lang.c Subject: Re: Shift by negative quantity Message-ID: <2282@umcp-cs.UUCP> Date: Sat, 5-Jul-86 13:24:45 EDT Article-I.D.: umcp-cs.2282 Posted: Sat Jul 5 13:24:45 1986 Date-Received: Sun, 6-Jul-86 01:25:53 EDT References: <894@bu-cs.UUCP> Reply-To: chris@maryland.UUCP (Chris Torek) Organization: University of Maryland, Dept. of Computer Sci. Lines: 17 In article <894@bu-cs.UUCP> bzs@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@umcp-cs ARPA: chris@mimsy.umd.edu