I need to invert the bits in a (very) large bitstring. Doing so is easy enough:
$bits = ~$bits;
The problem is that involves duplicating the entire bitstring and then copying it.
What I want is $bits ~= ?; but that obviously doesn't exist.
I could xor it with an equal length string of 1s, but same problem.
Can anyone think of a way of doing this whilst avoiding doubling the memory requirement?
In reply to In-place bitwise NOT? by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |