Hello,
Is there a ruby function to convert the following hexadecimal numbers
into the corresponding signed integers or will i need to write something
to do the conversion? Sorry if this question is stupid but i'm pretty
new to all this.
Hello,
Is there a ruby function to convert the following hexadecimal numbers
into the corresponding signed integers or will i need to write something
to do the conversion? Sorry if this question is stupid but i'm pretty
new to all this.
0xFF467A7B => -12158341
0x38CFEF => 3723247
The tricky part is dealing with the twos compliment notation but String#to_i will do the hex/decimal conversion:
--
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/