bittoggle()

Scalar. Returns the value of an expression after inverting the value of a specific bit.

Syntax

bittoggle ( expression, bit )

Parameters

expression

The initial value, as an integer or a long.

bit

Which bit to toggle.

Usage

The expression argument can be an integer or a long, but the bit argument must be an integer. The function returns the same datatype as the datatype of the expression argument.

Example

bittoggle (7, 3) returns 15, or in binary, bittoggle (0111, 3) returns 1111. The user cannot specify binary directly.