Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!brl-adm!adm!rgenter@j.bbn.com
From: rgenter@j.bbn.com (Rick Genter)
Newsgroups: comp.lang.c
Subject: Re: (unsigned) -1 yields all 1s
Message-ID: <1555@brl-adm.ARPA>
Date: Tue, 16-Dec-86 10:16:17 EST
Article-I.D.: brl-adm.1555
Posted: Tue Dec 16 10:16:17 1986
Date-Received: Wed, 17-Dec-86 07:29:17 EST
Sender: news@brl-adm.ARPA
Lines: 16

> 	Actually, I think (unsigned) -1 does have to give you a bit pattern of
> all 1's.  I can not find an explicit reason, but I can deduce this from the
> following: 
> [...]
> 	3.  The value in the range 0 to 2^n-1 (inclusive) congruent mod 2^n
> 	to -1 is 2^n-1.  In straight binary notation this value is repre-
> 	sented as all 1's.

This assumes your machine is in straight binary notation.  If your machine
uses one's complement notation (CDC Cyber?), -0 is represented as all ones.
					- Rick
--------
Rick Genter 				BBN Laboratories Inc.
(617) 497-3848				10 Moulton St.  6/512
rgenter@bbn.COM  (Internet new)		Cambridge, MA   02238
rgenter@bbnj.ARPA (Internet old)	seismo!bbn.com!rgenter (UUCP)