--- In [EMAIL PROTECTED], "Paul Herring" <[EMAIL PROTECTED]> wrote:
>
> On 12 Apr 2007 07:33:29 -0700, Nico Heinze <[EMAIL PROTECTED]> wrote:
> >
> > --- In [EMAIL PROTECTED], kathir resh <resh_personal@> wrote:
> > >
> > > The range of int is -32767 to +32768 but for long it
> > > varies. whenever the input to be used is of big in range
> > > (int type) long type is used
> > <snip>
> >
> > Sorry for being so pernickety, but the correct numbers for
> > the usual widespread 2's complement representation of 16-bit
> > integers are -32,768 to +32,767.
> 
> You're both wrong.
> 
> The Standard does not require 2's compliment to be used,
> and all a compiler is required to support is -32767 to +32767
> for ints.

Did I say anything different? Sorry, Paul, but all I stated was that
the widespread 2's complement representation for 16-bit integers
ranges from -32,768 to +32,767; I did not say anything about 2's
complement being required by ANSI C. I just wanted to correct the
numbers given by Kathir; I did not (and do not) dare to write any
"definite" statement about these details of ANSI C. I simply don't
know the standard well enough.

Nonetheless thanks for the clarification. It's interesting for me to
see that the standard defines the int range as -32,767 to +32,767; not
that I see any "real" reason for this assumption, but it makes life
easier in some cases, this much is sure.

</nitpick>

Regards,
Nico

Reply via email to