Converts number to a 8-bit signed integer presented as one byte. An input for the the conversion should be between -128.00 and 127.00.
number-to-i8
@/number-to-i8
Converts number to a 8-bit signed integer presented as one byte. An input for the the conversion should be between -128.00 and 127.00.
node {
void evaluate(Context ctx) {
int8_t byte = getValue<input_IN>(ctx);
emitValue<output_OUT>(ctx, byte);
}
}
| IN | OUT |
| 127.0 | 7Fh |
| -128.00 | 80h |
| 00h | 0.00 |
| -1.00 | FFh |