bit-not(number)

koadrobot/bits/bit-not(number)

Computes bitwise NOT of a number. Also known as complement. A resulting bit at a particular position is 1 when input bit at the same position is 0, and vice versa.
bit-not(number)
@/bit-not(number)
Computes bitwise NOT of a number. Also known as complement. A resulting bit at a particular position is 1 when input bit at the same position is 0, and vice versa.
INnumber
Input number. Interpreted as a signed 32-bit interger
bit-not(number)
IN
OUT
OUTnumber
To use the node in your project you should have the koadrobot/bits library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    int32_t x = (int32_t)getValue<input_IN>(ctx);
    emitValue<output_OUT>(ctx, ~x);
}

Tabular tests

INOUT
0255
1254
2550