User Profile
Collapse
-
Thank you so much!!! -
-
Sorry. Let me try to clarify. I am trying to convert 8-character hex values to their 32-bit integer representation. The problem arises when a hex string starts with FFFF (ex. FFFFFFCE). I know that the real answer once the conversion is done is "-50" for "FFFFFFCE". You can check it by entering "-50" into any calculator that does conversions, and you will see that the hex value for it is "FFFFFFCE". But...Leave a comment:
-
thanks for your reply. Actually, it is negative 50. I know that if I do the following: $t = hex('ffffffce') & hex('7ffffffff' ); $t = $t - hex('7fffffff') - 1;, I get the correct value of negative 50. But this is clunky.Leave a comment:
-
Converting hex string to 32 bit signed integer
I have a hex value FFFFFFCE that actually represents -50. When I simply use hex function to convert the above value to an integer, I get 4294967246. That means that integer overflow took place. How do I handle such cases, so that conversion will be correct?
No activity results to display
Show More
Leave a comment: