query
On this page

bitAnd

lib.bitAnd

Primop
Docs pulled from | This Revision | 18 days ago


Nix manual

Takes 2 arguments

e1, e2

Return the bitwise AND of the integers e1 and e2.

Noogle detected

Aliases

Detected Type
bitAnd :: Int -> Int -> Int

Implementation

This function is implemented in c++ and is part of the native nix runtime.

src/libexpr/primops.cc:4562

static void prim_bitAnd(EvalState & state, CallSite callSite, Value * const * args, Value & v)
{
    auto i1 = state.forceInt(*args[0], noPos, "while evaluating the first argument passed to builtins.bitAnd");
    auto i2 = state.forceInt(*args[1], noPos, "while evaluating the second argument passed to builtins.bitAnd");
    v.mkInt(i1.value & i2.value);
}

Implementation

The following is the current implementation of this function.

bitAnd