Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Message-ID | <4DCC597D.648C@mindspring.com> (permalink) |
|---|---|
| Date | 2011-05-12 18:04 -0400 |
| From | pete <pfiland@mindspring.com> |
| Organization | PF |
| Newsgroups | comp.lang.c |
| Subject | Re: Would someone tell me if I'm on the wrong track? |
| References | <70cf2865-5c4a-47a5-a8e8-ac369c2b91b3@k22g2000yqh.googlegroups.com> <4dca2cf0$0$18239$4fafbaef@reader2.news.tin.it> <35d5a07f-b868-4f6e-83fd-e333baba79fc@gu8g2000vbb.googlegroups.com> <4DCBCC1F.41A5@mindspring.com> <slrniso0q3.1his.usenet-nospam@guild.seebs.net> |
Seebs wrote: > > On 2011-05-12, pete <pfiland@mindspring.com> wrote: > >> unsigned sz; > >> (int) sz < 0 > > >> Does this just check the high bit (assuming 2's complement)? > > > I don't know, > > but I don't see the relevance of ((int) sz < 0). > > The relevance was in that question there. > > On a typical 2s complement system, > it is quite likely that if you convert > a value greater than INT_MAX but no larger than UINT_MAX > to a signed integer type, > you will end up with a negative value. Thus, > sz > INT_MAX > and > (int) sz < 0 > are both fancy ways of saying something much like: > > (sz & ((UNIT_MAX) & ~(UINT_MAX >> 1))) != 0 > > (unless my lack of morning coffee made me get that wrong...) But why would you care about whether or not an unsigned object held a value which was greater than INT_MAX? -- pete
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Would someone tell me if I'm on the wrong track? luser- -droog <mijoryx@yahoo.com> - 2011-05-09 23:47 -0700
Re: Would someone tell me if I'm on the wrong track? luser- -droog <mijoryx@yahoo.com> - 2011-05-10 00:05 -0700
Re: Would someone tell me if I'm on the wrong track? "io_x" <a@b.c.invalid> - 2011-05-11 08:31 +0200
Re: Would someone tell me if I'm on the wrong track? luser- -droog <mijoryx@yahoo.com> - 2011-05-10 23:46 -0700
Re: Would someone tell me if I'm on the wrong track? luser- -droog <mijoryx@yahoo.com> - 2011-05-11 23:05 -0700
Re: Would someone tell me if I'm on the wrong track? Seebs <usenet-nospam@seebs.net> - 2011-05-12 07:36 +0000
Re: Would someone tell me if I'm on the wrong track? pete <pfiland@mindspring.com> - 2011-05-12 07:51 -0400
Re: Would someone tell me if I'm on the wrong track? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-14 03:34 +0100
Re: Would someone tell me if I'm on the wrong track? pete <pfiland@mindspring.com> - 2011-05-13 23:19 -0400
Re: Would someone tell me if I'm on the wrong track? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-14 12:02 +0100
Re: Would someone tell me if I'm on the wrong track? pete <pfiland@mindspring.com> - 2011-05-12 08:01 -0400
Re: Would someone tell me if I'm on the wrong track? Seebs <usenet-nospam@seebs.net> - 2011-05-12 15:57 +0000
Re: Would someone tell me if I'm on the wrong track? pete <pfiland@mindspring.com> - 2011-05-12 18:04 -0400
Re: Would someone tell me if I'm on the wrong track? Seebs <usenet-nospam@seebs.net> - 2011-05-12 22:18 +0000
Re: Would someone tell me if I'm on the wrong track? luser- -droog <mijoryx@yahoo.com> - 2011-05-12 23:05 -0700
Re: Would someone tell me if I'm on the wrong track? "io_x" <a@b.c.invalid> - 2011-05-13 10:21 +0200
Re: Would someone tell me if I'm on the wrong track? luser- -droog <mijoryx@yahoo.com> - 2011-05-12 09:33 -0700
Re: Would someone tell me if I'm on the wrong track? Peter Nilsson <airia@acay.com.au> - 2011-05-12 22:47 -0700
Re: Would someone tell me if I'm on the wrong track? "io_x" <a@b.c.invalid> - 2011-05-13 10:21 +0200
Re: Would someone tell me if I'm on the wrong track? Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-18 22:21 -0700
Re: Would someone tell me if I'm on the wrong track? Peter Nilsson <airia@acay.com.au> - 2011-05-18 23:47 -0700
Re: Would someone tell me if I'm on the wrong track? Tim Rentsch <txr@alumni.caltech.edu> - 2011-05-19 11:00 -0700
csiph-web