By Daniel · January 4, 2009
Extracts one bit from some number n. bit=0 indicates the least significant bit (worth 1, usually written on the far right), bit=1 indicates the next (worth 2), and so forth; in general terms, bit=p refers to the bit worth 2^p.
See also: set_bit
/* get_bit(n, bit) * * Extracts one bit from some number n. bit=0 indicates the least significant * bit (worth 1, usually written on the far right), bit=1 indicates the next * (worth 2), and so forth; in general terms, bit=p refers to the bit worth 2^p. */ return (argument0 >> argument1) & 1;
Categories: Data processing, Mathematics
There are no comments to display.
You must be signed in to post comments.