bitSet

fun A_Number.bitSet(bitPosition: Int, value: Boolean, canDestroy: Boolean): A_Number

Produce an integer like the receiver, but with the bit corresponding to 2^bitPosition either set or cleared, depending on value. The receiver may be recycled or destroyed if canDestroy is true.

Receiver

The integerIntegerDescriptor to update or replace.

Return

The resulting integer.

Parameters

bitPosition

The bit position to update. If it's 0, update the lowest bit, and so on, updating the bit representing the value 2^bitPosition. This must be non-negative, and be within reasonable VM limits related to representing the output value.

value

If true, set the indicated bit in the result, otherwise clear it.

canDestroy

If true, the receiver may be recycled or destroyed if it happens to be mutable.