i32-to-number

xod/bits/i32-to-number

Converts 32-bit signed integer presented as four bytes to a number. A result of the conversion will be between -2147483600.00 and 2147483600.00.
i32-to-number
@/i32-to-number
Converts 32-bit signed integer presented as four bytes to a number. A result of the conversion will be between -2147483600.00 and 2147483600.00.
B2byte
B3byte
Most significant byte
B1byte
B0byte
Least significant byte
i32-to-number
OUT
B2
B3
B1
B0
OUTnumber

C++ implementation

node {
    void evaluate(Context ctx) {
      int32_t b3 = getValue<input_B3>(ctx);
      int32_t b2 = getValue<input_B2>(ctx);
      int32_t b1 = getValue<input_B1>(ctx);
      int32_t b0 = getValue<input_B0>(ctx);
      int32_t num = ((b3 << 24) | (b2 << 16) | (b1 << 8) | b0);
      Number result = (Number)num;
      emitValue<output_OUT>(ctx, result);
    }
}

Tabular tests

B3B2B1B0OUT
7FhFFhFFhFFh2147483647.00
80h00h00h00h-2147483648.00
00h00h00hFFh255.00
00h00h7FhFFh32767.00
FFhFFh80h01h-32767.00
FFhFFhFFhFFh-1.00
00h00h00h00h0.00