You can replace ~$a with $a^0xffff (or $a^0xff for byte-wise bit negation).
- tye
In reply to Re: Casting numbers (^) by tye in thread Casting numbers by bfilipow