print unpack('l', pack 'L', hex 'F4EC9E00')/256; #### $n = hex 'F4EC9E'; if($n >= 2**23) { $n -= 2**24 } print $n;