Re: comparison between signed and unsigned int
- From: Army1987 <army1987@xxxxxxxxx>
- Date: Fri, 21 Sep 2007 21:37:10 +0200
On Fri, 21 Sep 2007 06:16:07 -0700, compcreator wrote:
I have tried the following program. The problem is it is printingLast time I checked 5 wasn't lower than -1.
False
I checked values for a and b but there is something wrong with the
comparison.
I thing it might be because of signed and unsigned conversion.
Either b is upgraded to unsigned and the resulting value during
comparison is > 5 or a is downgraded to signed and the resulting value
is lower than -1.
--
Army1987 (Replace "NOSPAM" with "email")
If you're sending e-mail from a Windows machine, turn off Microsoft's
stupid “Smart Quotes” feature. This is so you'll avoid sprinkling garbage
characters through your mail. -- Eric S. Raymond and Rick Moen
.
- References:
- comparison between signed and unsigned int
- From: compcreator
- comparison between signed and unsigned int
- Prev by Date: Re: Logical XOR
- Next by Date: Re: EOF
- Previous by thread: Re: comparison between signed and unsigned int
- Next by thread: X11 trouble
- Index(es):
Relevant Pages
|