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.
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);
}
}
B3 | B2 | B1 | B0 | OUT |
7Fh | FFh | FFh | FFh | 2147483647.00 |
80h | 00h | 00h | 00h | -2147483648.00 |
00h | 00h | 00h | FFh | 255.00 |
00h | 00h | 7Fh | FFh | 32767.00 |
FFh | FFh | 80h | 01h | -32767.00 |
FFh | FFh | FFh | FFh | -1.00 |
00h | 00h | 00h | 00h | 0.00 |