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


Groups > comp.lang.c > #3930

Re: Would someone tell me if I'm on the wrong track?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!news.glorb.com!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Fri, 13 May 2011 22:19:34 -0500
Message-ID <4DCDF4CC.7B20@mindspring.com> (permalink)
Date Fri, 13 May 2011 23:19:40 -0400
From pete <pfiland@mindspring.com>
Reply-To pfiland@mindspring.com
Organization PF
X-Mailer Mozilla 3.04Gold (WinNT; I)
MIME-Version 1.0
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> <slrnisn3ei.108u.usenet-nospam@guild.seebs.net> <0.3cd58643cabd7ca9ddca.20110514033459BST.87wrhuxb58.fsf@bsb.me.uk>
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Lines 25
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 4.154.219.211
X-Trace sv3-v9NxQwp35YG2yGSKDyXHnT7odOo3rWZj22JIEynDZMhiA0qvIx6VJuIPpV3iMmyc56uZV5D/BM6tRSA!/LDvUERD2aDd7Ld7ko/ajLB6iYs64lAxU5RCgYEuA95wrX4T/QwiLMFF9vanDnxtIoI8JRto6ijj!zk7e6QlZtwU=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2077
Xref x330-a1.tempe.blueboxinc.net comp.lang.c:3930

Show key headers only | View raw


Ben Bacarisse wrote:
> 
> Seebs <usenet-nospam@seebs.net> writes:
> 
> > On 2011-05-12, luser- -droog <mijoryx@yahoo.com> wrote:
> >> unsigned sz;
> >> (int) sz < 0
> >>
> >> Does this just check the high bit (assuming 2's complement)?
> >
> > Not necessarily.
> >
> > If you're comfortable assuming 2s complement, I bet you can do better with:
> >       sz > INT_MAX
> 
> The assumption is not 2's complement as far as I can see.  Your test
> works in all of C's three permitted signed integer representations (how
> can it not? -- it does not involve any signed integers).  It fails if
> unsigned int has more then one more value bit that signed int.

Also if
unsigned int has less than one more value bit than signed int.

-- 
pete

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


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