S
stylechief
I cannot seem to find a Perl function that will return the 2's
complement of a negative integer represented in hex.
For example:
ffbe8e should return -16754, not 16760462
hex() works fine for positive integers but not here
pack/unpack don't seem to want to produce anything negative (just 0)
I imagine that there is a 'brute force' method, but it seems that there
should be an eloquent function that speaks in 2's complement . . . .
Thanks,
Liam
complement of a negative integer represented in hex.
For example:
ffbe8e should return -16754, not 16760462
hex() works fine for positive integers but not here
pack/unpack don't seem to want to produce anything negative (just 0)
I imagine that there is a 'brute force' method, but it seems that there
should be an eloquent function that speaks in 2's complement . . . .
Thanks,
Liam