Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: # to the nth power Message-ID: <14379@smoke.brl.mil> Date: 7 Nov 90 11:27:22 GMT References: <522@ssp9.idca.tds.philips.nl> <1990Nov2.182217.13958@NCoast.ORG> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article enag@ifi.uio.no (Erik Naggum) writes: -In article <1990Nov2.182217.13958@NCoast.ORG> catfood@NCoast.ORG (Mark W. Schumann) writes: - Spiffy, but it does depend on (exponent & 1) being the same as saying - "exponent is odd." Most implementations support this, though. That's good, because the C standard requires this, for positive integers. -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? Other way around.