[ Arithmetic | Reference Manual | Alphabetic Index ]
clrbit(+Number, +Index, -Result)
-Result is clrbit(+Number, +Index)
Result is Number with the Index'th bit cleared.
- Number
- Integer.
- Index
- Non-negative integer.
- Result
- Output: integer.
Description
Clear the Index'th bit in Number giving Result. The least significant
bit has index zero. Two's complement representation is assumed.
This predicate can be used as a function in arithmetic expressions.
In coroutining mode, if Number or Index are uninstantiated, the call
is delayed until these variables are instantiated.
Modes and Determinism
Exceptions
- (4) instantiation fault
- Number or Index is not instantiated (non-coroutining mode only).
- (5) type error
- Number or Index is a number but not an integer.
- (24) number expected
- Number or Index is not of a numeric type.
Examples
Result is clrbit(15, 3). % gives Result = 7
Result is clrbit(40, 3). % gives Result = 32
Result is clrbit(setbit(0,5),5). % gives Result = 0
See Also
is / 2, setbit / 3, getbit / 3, lsb / 2, msb / 2, popcount / 2