6.5.7.4 Bitwise shift operators
From: joshc (josh.curtz_at_gmail.com)
Date: 03/30/05
- Next message: Don: "Retrieving a value from a void function."
- Previous message: Peter : "Re: Concat string (not ended ...)"
- Next in thread: Eric Sosman: "Re: 6.5.7.4 Bitwise shift operators"
- Reply: Eric Sosman: "Re: 6.5.7.4 Bitwise shift operators"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Mar 2005 19:00:42 -0800
I have a question about the following:
4. The result of E1 << E2 is E1 left-shifted E2 bit positions: vacated
bits are filled with zeros. ... If E1 has a signed type and a
nonnegative value, and E1x2^32 is representable in the result type,
then that is the resulting value; otherwise, the behavior is undefined.
I am a bit confused by this last clause- "otherwise, the behavior is
undefined." Does this mean I should not left *** a signed negative
value because undefined behavior will result? Or is the standard just
saying that nothing can be said about the value of the result of left
shifting a negative value? Am I at least guaranteed that the binary
representation of the signed negative integer will just be shifted left
'E2' bits?
Thanks.
- Next message: Don: "Retrieving a value from a void function."
- Previous message: Peter : "Re: Concat string (not ended ...)"
- Next in thread: Eric Sosman: "Re: 6.5.7.4 Bitwise shift operators"
- Reply: Eric Sosman: "Re: 6.5.7.4 Bitwise shift operators"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]