bitset()

Scalar. Returns the value of an expression after setting a specific bit to 1.

Syntax

bitset ( expression, bit )

Parameters

expression

The initial value as an integer or a long.

bit

Which bit to set, starting from 0 as the least-significant bit.

Usage

A bit argument must be an integer. The function returns the same datatype as the initial expression argument.

Example

bitset (2, 3) returns 10, or in binary, bitset (0010, 3) returns 1010. The user cannot specify binary directly.