Re: Fast sincos routine
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 03/08/04
- Next message: Sathyaish: "Re: Please tell me if I've written this correctly"
- Previous message: Irrwahn Grausewitz: "Re: puts with numbers"
- In reply to: Clark Cox: "Re: Fast sincos routine"
- Next in thread: pete: "Re: Fast sincos routine"
- Reply: pete: "Re: Fast sincos routine"
- Reply: Larry Doolittle: "Re: Fast sincos routine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 08 Mar 2004 15:51:25 GMT
Clark Cox wrote:
> CBFalconer <cbfalconer@yahoo.com> wrote:
> > Larry Doolittle wrote:
> > > In article <404AB2CE.81FD61ED@yahoo.com>, CBFalconer wrote:
> > >
> > > > however
> > > >
> > > > if (a > 0) a = -a;
> > > >
> > > > will force it to the range INT_MIN .. 0. Thus this is the proper
> > > > operation when translating to text and extracting signs. The
> > > > result can now be fearlessly converted into an unsigned.
> > >
> > > And what then? That unsigned number cannot be twiddled
> > > to represent the absolute value, according to pete
> > > (pfiland@mindspring.com), who comes up with the example
> > > UINT_MAX == 65535
> > > INT_MIN == -65536
> > > CHAR_BIT == 16
> > > INT_MAX == 65535
> > > sizeof(unsigned) == 2
> > > sizeof(int) == 2
> > > and the generaliziation "unsigned isn't guaranteed to be
> > > able to represent the magnitude of INT_MIN."
> >
> > Yes it is. Of the legal integer representations, ones, twos
> > complement, and sign magnitude, there is always a sign bit
> > (specified). That bit is always available for reuse in an
> > unsigned, thus automatically doubling the range. The situation
> > above is not possible.
>
> After a quick glance, I see nothing in the standard that says
> that that extra bit actually *has* to be used. So I see no
> reason why an implementation can't have INT_MAX == UINT_MAX.
I believe sections 6.2.5 and 6.2.6.2 of N869 cover it. Things are
widely spread out, so it takes a Dan Pop to correlate everything.
-- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
- Next message: Sathyaish: "Re: Please tell me if I've written this correctly"
- Previous message: Irrwahn Grausewitz: "Re: puts with numbers"
- In reply to: Clark Cox: "Re: Fast sincos routine"
- Next in thread: pete: "Re: Fast sincos routine"
- Reply: pete: "Re: Fast sincos routine"
- Reply: Larry Doolittle: "Re: Fast sincos routine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|