
clrbit(+Number, +Index, -Result)

   Result is Number with the Index'th bit cleared.



Arguments
   Number              Integer.
   Index               Non-negative integer.
   Result              A variable or integer.

Type
   Arithmetic

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 is used by the ECLiPSe compiler to expand evaluable
   arithmetic expressions.  So the call to clrbit(Number, Index, Result) is
   equivalent to

    Result is clrbit(Number, Index)

   which should be preferred.


   In coroutining mode, if Number or Index are uninstantiated, the call
   is delayed until these variables are instantiated.




Modes and Determinism
   clrbit(+, +, -) is det

Exceptions
     4 --- Number or Index is not instantiated (non-coroutining mode    only).
     5 --- Result is a number but not an integer.
     5 --- Number or Index is a number but not an integer.
    24 --- Number or Index is not of a numeric type.
    24 --- Result is neither a number nor a variable.

Examples
   
Success:
      clrbit(15, 3, 7).
      clrbit(40, 3, X).            gives X=32.
      X is clrbit(setbit(0,5),5).  gives X=0.





See Also
   is / 2, setbit / 3, getbit / 3
