Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!aplcomm!uunet!ingr!b11!dan From: dan@b11.ingr.com (Dan Webb) Newsgroups: comp.lang.c Subject: Re: # to the nth power Message-ID: <9314@b11.ingr.com> Date: 4 Nov 90 02:30:16 GMT References: <9750@helios.TAMU.EDU> <1990Nov1.232830.17131@NCoast.ORG> Organization: Intergraph Corp. Huntsville, AL Lines: 21 In article , enag@ifi.uio.no (Erik Naggum) writes: > For all positive integers, you can prove that odd integers have the > least significant bit equal to one, and even integers have the least > significant bit equal to zero, when represented in binary. Hint: odd, > positive integers have a remainder of 1 when divided by 2. > > For a ones-complement architectures, this even holds for negative > integers. Twos-complement architectures will return "odd" for an even > negative number in this simple test. Was that what you were thinking > of? I think you've got that backwards. In 2's complement, -1 has all bits set, and it's certainly an odd number. I think the bottom line is that in 2's complement notation, the LSBit means an odd number. Period. ---------------------- Dan Webb Intergraph Corp. ...!uunet!ingr!b11!dan