Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: How do I convert from decimal to 2's Complement

by mdillon (Priest)
on Apr 08, 2002 at 06:34 UTC ( [id://157377]=note: print w/replies, xml ) Need Help??


in reply to Re: How do I convert from decimal to 2's Complement
in thread How do I convert from decimal to 2's Complement

This one is correct (as I'm sure I0 knows).

From perldoc -f pack:

c   A signed char value.
...
i   A signed integer value.
    (This 'integer' is at least 32 bits wide.  Its exact
    size depends on what a local C compiler calls 'int',
    and may even be larger than the 'long' described in
    the next item.)
The question asks specifically for signed 8-bit, which is "c", a signed char value (8 bits). "At least 32 bits" is not 8 bits.
  • Comment on Re: Re: How do I convert from decimal to 2's Complement

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://157377]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (None)
    As of 2024-04-25 00:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found