u16-to-number

xod/bits/u16-to-number

Converts 16-bit unsigned integer presented as two bytes to a number. A result of the conversion will be between 0.00 and 65535.00.
u16-to-number
@/u16-to-number
Converts 16-bit unsigned integer presented as two bytes to a number. A result of the conversion will be between 0.00 and 65535.00.
B1byte
Most significant byte
B0byte
Least significant byte
u16-to-number
OUT
B1
B0
OUTnumber

C++ implementation

node {
    void evaluate(Context ctx) {
        uint8_t b1 = getValue<input_B1>(ctx);
        uint8_t b0 = getValue<input_B0>(ctx);
        uint16_t num = ((b1 << 8) | b0);
        Number result = (Number)num;
        emitValue<output_OUT>(ctx, result);
    }
}

Tabular tests

B1B0OUT
FFhFFh65535.00
3Ch6Bh15467.00
00h00h0.00