From: G DOT DegliEsposti AT ads DOT it To: djgpp AT delorie DOT com Message-ID: Date: Thu, 15 Jan 1998 09:23:50 +0100 Subject: Re: Re: Bit fields in djgpp Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Precedence: bulk >>Sorry, I was wrong. The ANSI C Standard explicitly says that signed bit >>fields of size N can be used to represent values in the range [0, 2^(N-1)) >>so when N is 1, you cannot represent 1. You need to make it unsigned, as even worse... for N=1 you can use values in range 0 <= x <= -1 i.e. none! ;-) >>Nate suggested. > >Oughtn't that to be: >[0..(2^(N-1))-1] ? >Because, for instance, a 16-bit signed value can only go up to 32767. you both are right! if you look better you will see a ')' where you put a ']'! Both [a..b-1] and [a..b) specify the same range of integers x such that a<=x