in reply to Re^4: Converting negative number to binary with specific width
in thread Converting negative number to binary with specific width

do you have to use it? Isn't unpack 'b10' enough?
  • Comment on Re^5: Converting negative number to binary with specific width

Replies are listed 'Best First'.
Re^6: Converting negative number to binary with specific width
by AnomalousMonk (Archbishop) on Nov 03, 2015 at 10:33 UTC

    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:  <%-{-{-{-<