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


Groups > comp.lang.c > #12943

Re: overflow problem?

From Nobody <nobody@nowhere.com>
Subject Re: overflow problem?
Date 2011-11-09 09:05 +0000
Message-Id <pan.2011.11.09.09.05.50.350000@nowhere.com>
Newsgroups comp.lang.c
References <j9c9o3$fhi$1@speranza.aioe.org> <4EB9BAB6.7040504@verizon.net>
Organization Zen Internet

Show all headers | View raw


On Tue, 08 Nov 2011 18:26:46 -0500, James Kuyper wrote:

> I'll assume, as you seem to be, that CHAR_BIT==8.

Actually, you appear to be assuming that CHAR_BIT==9 ;)

> If char is signed:
> If the bit pattern is 10000000, the '1' is presumably the sign bit.
> Which number it represents would depend upon which of the three
> representations allowed by C is used:
> 	sign and magnitude - negative zero
> 	two's complement: -256
> 	one's complement: -255

The last two should be -128 and -127 respectively for CHAR_BIT==8.

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


Thread

overflow problem? Greg <nospam@nospam.com> - 2011-11-08 22:16 +0000
  Re: overflow problem? Keith Thompson <kst-u@mib.org> - 2011-11-08 14:33 -0800
  Re: overflow problem? James Kuyper <jameskuyper@verizon.net> - 2011-11-08 18:26 -0500
    Re: overflow problem? Nobody <nobody@nowhere.com> - 2011-11-09 09:05 +0000
      Re: overflow problem? James Kuyper <jameskuyper@verizon.net> - 2011-11-09 06:40 -0500
        Re: overflow problem? Greg <nospam@nospam.com> - 2011-11-09 20:01 +0000
          Re: overflow problem? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-10 01:29 -0800

csiph-web