bitMaskClear

Performs a bitwise mask clear operation.

bitMaskClear(number, start, length) → returns Numeric

Argument Reference for the bitMaskClear function

number

Required: Yes
Integer

start

Required: Yes
Start bit for the mask (Integer in the range 0-31, inclusive)

length

Required: Yes
Length of bits in the mask (Integer in the range 0-31, inclusive)

Examples sample code invoking the bitMaskClear function


Bitwise Mask Clear

Uses the bitMaskClear function to clear (setting to 0) each of the corresponding bits

bitMaskClear(3, 0, 1)

Expected Result: 2


Using non zero start parameter

bitMaskClear(3, 1, 1)

Expected Result: 1


Using non zero mask start and length parameters

bitMaskClear(10, 1, 2)

Expected Result: 8


Fork me on GitHub