Re: value of the constant expression 1<<(1?1:1) < 0x9999
- From: Peter Nilsson <airia@xxxxxxxxxxx>
- Date: Tue, 29 Apr 2008 16:13:21 -0700 (PDT)
Keith Thompson wrote:
...
I'll assume that types int and unsigned int are 16 bits.
1<<(1?1:1) has the value 2 and is of type int.
0x9999 has the value 39321 and is of type unsigned int.
The "usual arithmetic conversions" are applied to the operands
of "<". This converts the left operand, 2, from int to unsigned int.
So the expression 1<<(1?1:1) < 0x9999 is equivalent to
1U < 39321U,
ITYM: 2U < 39321U
--
Peter
.
- Follow-Ups:
- Re: value of the constant expression 1<<(1?1:1) < 0x9999
- From: Keith Thompson
- Re: value of the constant expression 1<<(1?1:1) < 0x9999
- References:
- value of the constant expression 1<<(1?1:1) < 0x9999
- From: Francois Grieu
- Re: value of the constant expression 1<<(1?1:1) < 0x9999
- From: Keith Thompson
- value of the constant expression 1<<(1?1:1) < 0x9999
- Prev by Date: Re: value of the constant expression 1<<(1?1:1) < 0x9999
- Next by Date: Re: sorting the input
- Previous by thread: Re: value of the constant expression 1<<(1?1:1) < 0x9999
- Next by thread: Re: value of the constant expression 1<<(1?1:1) < 0x9999
- Index(es):
Relevant Pages
|