Try it and see. What result do you get? Are you happy with it? If yes, then you're done! (Of course, I'm not saying there is no other possible pack/unpack/reverse/sprintf/substr/whatever incantation that would do as well or better; see Convert ASCII string to 7-bit binary string for a recent, eerily similar discussion.)
Give a man a fish: <%-{-{-{-<
In reply to Re^6: Converting negative number to binary with specific width
by AnomalousMonk
in thread Converting negative number to binary with specific width
by pjkang7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |