Re: comparison between signed and unsigned int



On Fri, 21 Sep 2007 06:16:07 -0700, compcreator wrote:

I have tried the following program. The problem is it is printing
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.
Last time I checked 5 wasn't 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

.



Relevant Pages

  • Re: how can I return nothing?
    ... stupid “Smart Quotes” feature. ... This is so you'll avoid sprinkling garbage ... characters through your mail. ...
    (comp.lang.c)
  • Re: Very big numbers
    ... stupid “Smart Quotes” feature. ... This is so you'll avoid sprinkling garbage ... characters through your mail. ... -- Eric S. Raymond and Rick Moen ...
    (comp.lang.c)
  • Re: Struct size
    ... stupid “Smart Quotes” feature. ... This is so you'll avoid sprinkling garbage ... characters through your mail. ... -- Eric S. Raymond and Rick Moen ...
    (comp.lang.c)
  • Re: how can I return nothing?
    ... stupid “Smart Quotes” feature. ... This is so you'll avoid sprinkling garbage ... characters through your mail. ... -- Eric S. Raymond and Rick Moen ...
    (comp.lang.c)