From owner-freebsd-chat Thu Jan 6 8: 6: 2 2000 Delivered-To: freebsd-chat@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id CD0F8155DE for ; Thu, 6 Jan 2000 08:05:59 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id LAA20035; Thu, 6 Jan 2000 11:08:11 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <200001061608.LAA20035@cc942873-a.ewndsr1.nj.home.com> Subject: Re: I will never trust NBC news again! In-Reply-To: from Jonathon McKitrick at "Jan 6, 2000 02:19:23 pm" To: jcm@dogma.freebsd-uk.eu.org (Jonathon McKitrick) Date: Thu, 6 Jan 2000 11:08:11 -0500 (EST) Cc: tom@embt.com (Tom Embt), cjclark@home.com, chat@freebsd.org Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Jonathon McKitrick wrote, > > >BTW, I *think* it would be 2^31-1 not 2^31. For example, doesn't a char > >store values from -128 to 127 ? > > Only if it's treated as a signed value. If it is unsigned, then the extra > bit can be used for value storage. ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I think that is a misleading way to phrase it or think about it. In signed or unsigned integer-types, all bits are used for "value storage." This is seen in your example, > signed int: -128 127 > unsigned: 0 255 Both of these ranges contain 256 values, the number of states that 8 binary switches can assume. All bits are used for "value storage." How we map those 256 states to the mathematical objects, like integers, is up to the programmer. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message