query
On this page

bitAnd

lib.trivial.bitAnd

Primop
Docs pulled from | This Revision | 18 minutes 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:4582

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