Converts number to a 32-bit signed integer presented as 4 bytes. An input for the the conversion should be between -2147483600.00 and 2147483600.00.
number-to-i32
@/number-to-i32
Converts number to a 32-bit signed integer presented as 4 bytes. An input for the the conversion should be between -2147483600.00 and 2147483600.00.
B0byte
Least significant byte
B3byte
Most significant byte
node {
void evaluate(Context ctx) {
int32_t val = getValue<input_IN>(ctx);
uint8_t b3 = (val >> 24);
uint8_t b2 = (val >> 16);
uint8_t b1 = (val >> 8);
uint8_t b0 = val;
emitValue<output_B0>(ctx, b0);
emitValue<output_B1>(ctx, b1);
emitValue<output_B2>(ctx, b2);
emitValue<output_B3>(ctx, b3);
}
}
IN | B3 | B2 | B1 | B0 |
-15999999.00 | FFh | 0Bh | DCh | 01h |
15999999.00 | 00h | F4h | 23h | FFh |
255.00 | 00h | 00h | 00h | FFh |
32767.00 | 00h | 00h | 7Fh | FFh |
-32767.00 | FFh | FFh | 80h | 01h |