But I was trying to get a solution for small negative numbers, no more than -127 which is the limit of 8 bit int.
If you want to pack 8-bit numbers, do not use 32-bit templates; nor 'B32'.
Think! read, and think again.
(Hint:8-bit signed numbers; 'B8' and 'c'...)
In reply to Re^3: How to convert between decimal and binary for negative numbers?
by BrowserUk
in thread How to convert between decimal and binary for positive/negative numbers?
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |