From: akolarik@... Date: 2002-09-19T04:53:37+09:00 Subject: signed hex conversion This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C25F4D.10B65320 Content-Type: text/plain; charset="iso-8859-1" > I'd like to convert a string representing a 32 bit signed number like: > "FFFFFFC4" or "0xFFFFFFC4" > into the integer value > -60 > or a string like > "-60" > and am not having a lot of luck with .hex, to_s, and .to_i. > > Any help would be appreciated. > -- Tony K. ------_=_NextPart_001_01C25F4D.10B65320 Content-Type: text/html; charset="iso-8859-1"
I'd like to convert a string representing a 32 bit signed number like:
"FFFFFFC4" or "0xFFFFFFC4"
into the integer value
-60
or a string like
"-60"
and am not having a lot of luck with .hex, to_s, and .to_i.
Any help would be appreciated.
-- Tony K.