Abstract
We give low-level functions for binary words, such as isolation of the lowest set bit or counting all set bits. Sometimes the term `one' is used for a set bit and `zero' for an unset bit. Where it cannot cause confusion, the term `bit' is used for a set bit (as in \counting the bits of a word"). The C-type unsigned long is abbreviated as ulong as de_ned in [FXT: fxttypes.h]. It is assumed that BITS_PER_LONG reects the size of an unsigned long. It is de_ned in [FXT: bits/bitsperlong.h] and usually equals the machine word size: the quantity BYTES_PER_LONG reects the number of bytes in a machine word: it equals BITS_PER_LONG divided by eight. For some functions it is assumed that long and ulong have the same number of bits.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2011 Springer Berlin Heidelberg
About this chapter
Cite this chapter
Arndt, J. (2011). Bit wizardry. In: Matters Computational. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14764-7_1
Download citation
DOI: https://doi.org/10.1007/978-3-642-14764-7_1
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-14763-0
Online ISBN: 978-3-642-14764-7
eBook Packages: Computer ScienceComputer Science (R0)