Subject: Re: 2s complement
To: Terry Moore <tmm@mcci.com>
From: None <zvrba@globalnet.hr>
List: tech-kern
Date: 01/07/2006 08:34:37
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

On Sat, Jan 07, 2006 at 12:10:32AM -0500, Terry Moore wrote:
> 
> Therefore, I suspect that people using <bitstring.h> are probably 
> using it for convenience/clarity and are not likely to be terribly 
> concerned about performance.
> 
The Hacker's Delight book has 7 pages dedicated to various ways of
computing the "number of leading/trailing zeros" functions. For a given
bitstring of arbitrary length, one would first find the first nonzero
word, and then techniques from HD can be applied. One suggested
technique is even to use IEEE FP arithmetic ;)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD4DBQFDv28NFtofFpCIfhMRA8cqAJi8NGE7RIY3H6XH4h/Z1eCC19DkAJkBGmVl
74q05XUZV0wwpYbRAIYMxA==
=xec8
-----END PGP SIGNATURE-----