Re: Direct computation of integer limits in K&R2?



Ioannis Vranos wrote:

.... snip ...

OK it is allowed, but is there any existing system where the value
ranges of signed int and unsigned int are different?

Yes. Consider a 16 bit system. INT_MAX is 32767. INT_MIN is
-32768 (or -32767). UINT_MAX is 65536 (UINT_MIN is naturally 0).
It is allowable to reserve the value that would represent -32768 to
indicate a special condition, such as uninitialized. Or, for a 1's
complement machine, the bit pattern for -0 is forbidden.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Direct computation of integer limits in K&R2?
    ... snip ... ... ranges of signed int and unsigned int are different? ...
    (comp.lang.c)
  • Re: Direct computation of integer limits in K&R2?
    ... ranges of signed int and unsigned int are different? ... It is allowable to reserve the value that would represent -32768 to ...
    (comp.lang.c)
  • Re: Direct computation of integer limits in K&R2?
    ... unsigned int are allowed to be padding bits in the signed int. ... but is there any existing system where the value ranges of signed int and unsigned int are different? ...
    (comp.lang.c)
  • Re: C standard question?
    ... uc1 gets promoted to a signed int ... On many implementations, perhaps including all those you have ever ... uc1 gets promoted to signed int. ... Of course, on implementations where uc1 is promoted to unsigned int, ...
    (comp.lang.c)
  • Re: GCC bitfield packing
    ... The actual amount of storage taken us depends only upon the number of ... depend upon the type of the bitfield declaration. ... _Bool, int, signed int, and unsigned int. ...
    (comp.std.c)