Two's complement

From OpenMotics
Revision as of 13:24, 25 October 2020 by Wilbert (talk | contribs) (Created page with "Values like offset are being written in Two's complement notation. This means that, when using Basic Action, a byte value (0-255) can also represent a negative value. Byte va...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Values like offset are being written in Two's complement notation. This means that, when using Basic Action, a byte value (0-255) can also represent a negative value.

Byte value is converted in Two's complement:

Byte Value Two's complement
128 -128
... ...
251 -5
252 -4
253 -3
254 -2
255 -1
0 0
1 +1
2 +2
3 +3
4 +4
5 +5
... ...
127 +127