1994-07-03 - Re: Dr. Dobbs Dev. Update 1/5 July 94 & Schneier

Header Data

From: tim werner <werner@mc.ab.com>
To: norm@netcom.com
Message Hash: 46c459fb55f286b372844efc279634e9801e043198aedd23d4d12c0112490498
Message ID: <199407031505.LAA18047@sparcserver.mc.ab.com>
Reply To: N/A
UTC Datetime: 1994-07-03 15:06:09 UTC
Raw Date: Sun, 3 Jul 94 08:06:09 PDT

Raw message

From: tim werner <werner@mc.ab.com>
Date: Sun, 3 Jul 94 08:06:09 PDT
To: norm@netcom.com
Subject: Re: Dr. Dobbs Dev. Update 1/5 July 94 & Schneier
Message-ID: <199407031505.LAA18047@sparcserver.mc.ab.com>
MIME-Version: 1.0
Content-Type: text/plain


>Date: Sun, 3 Jul 1994 01:24:39 -0700
>From: norm@netcom.com (Norman Hardy)
>At 01:00 1994/07/03 -0400, tim werner wrote:
>>...  I had to write a little loop to
>>check the number of bits set in a word.
>>...  The loop was really a waste when you consider that it could
>>have been done in 1 instruction.

>In C, {int j... if(j & (j-1)) not_exactly_one_bit; ...}

I knew if I subscribed to this list I'd eventually pick up something
useful.  I already asked a couple of people at work if they knew of a
trick to see if there was just one bit set, and no one did.
Otherwise I would feel extra stupid.  :-)

tw





Thread