Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #11540

unsigned == signed ?

From Raj Pashwar <raj121190@hotmail.NOSPAM.com>
Newsgroups comp.lang.c
Subject unsigned == signed ?
Date 2011-10-11 19:43 +0000
Organization Aioe.org NNTP Server
Message-ID <j72687$bcn$1@speranza.aioe.org> (permalink)

Show all headers | View raw


int main()
{
uint x = -1;
int y = -1;
if (x == y)
printf("EQUAL");
else
printf("NOT EQUAL");
}

This code prints "EQUAL". Does this mean that bit comparison is done for 
the
equality test? If it doesn't can you give me an example that shows bit
comparison isn't done? I also wanted to know if we can assign a number to
uint & int variables such that "unit var != int var". Thanks so much 

Back to comp.lang.c | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

unsigned == signed ? Raj Pashwar <raj121190@hotmail.NOSPAM.com> - 2011-10-11 19:43 +0000
  Re: unsigned == signed ? Keith Thompson <kst-u@mib.org> - 2011-10-11 12:57 -0700
  Re: unsigned == signed ? James Kuyper <jameskuyper@verizon.net> - 2011-10-11 16:23 -0400
  Re: unsigned == signed ? Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2011-10-11 20:33 +0000
    Re: unsigned == signed ? James Kuyper <jameskuyper@verizon.net> - 2011-10-11 16:40 -0400
    Re: unsigned == signed ? Keith Thompson <kst-u@mib.org> - 2011-10-11 14:34 -0700
      Re: unsigned == signed ? Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2011-10-12 16:04 +0000
        Re: unsigned == signed ? Keith Thompson <kst-u@mib.org> - 2011-10-12 10:49 -0700
        Re: unsigned == signed ? pete <pfiland@mindspring.com> - 2011-10-12 21:12 -0400
    Re: unsigned == signed ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-10-11 22:35 +0100
      Re: unsigned == signed ? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-10-13 14:54 +0300
        Re: unsigned == signed ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-10-13 15:26 +0100
    Re: unsigned == signed ? "J. J. Farrell" <jjf@bcs.org.uk> - 2011-10-12 03:02 +0100
  Re: unsigned == signed ? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-10-13 13:56 +0300

csiph-web