xHarbour Reference Documentation > Function Reference |
Sets one or more bits of a numeric integer value to 0.
ClearBit( <nInteger>|<cHex>,[<nBitPos,...>]) --> nNewValue
The function returns a numeric integer value with the bits at the specified positions set to 0.
See also: | IsBit(), NumAND(), NumNOT(), NumOR(), NumXOR(), SetBit() |
Category: | CT:NumBits , Numbers and Bits |
Source: | ct\bit2.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example displays results of ClearBit() along with the // binary representation of numbers. PROCEDURE Main ? NtoC( 255, 2, 8, "0" ) // result: 11111111 ? n := ClearBit( 255, 1, 7 ) // result: 190.00 ? NtoC( n, 2, 8, "0" ) // result: 10111110 ? n := ClearBit( 255, 2, 4, 6 ) // result: 213.00 ? NtoC( n, 2, 8, "0" ) // result: 11010101 RETURN
http://www.xHarbour.com