Condividi tramite


BITCLEAR( ) Function

Clears a specified bit (sets it to 0) in a numeric value and returns the resulting value.

BITCLEAR(nExpression1, nExpression2)

Return Values

Numeric

Parameters

  • nExpression1
    Specifies the numeric value in which a bit is cleared. If nExpression1 is not an integer, it is converted to an integer before its bit is set.
  • nExpression2
    Specifies the bit position in nExpression1 that is cleared. nExpression2 can range from 0 to 31; 0 is the rightmost bit.

Example

x = 7  && 0111 binary
y = 1  && 2nd bit position (0 = 1st bit position)
? BITCLEAR(x,y) && Returns 5, 0101 binary

See Also

BITAND( ) | BITLSHIFT( ) | BITNOT( ) | BITOR( ) | BITRSHIFT( ) | BITSET( ) | BITTEST( ) | BITXOR( )