|P is for Practical|
In-place bitwise NOT?by BrowserUk (Pope)
|on Jul 26, 2013 at 17:27 UTC||Need Help??|
BrowserUk has asked for the
wisdom of the Perl Monks concerning the following question:
I need to invert the bits in a (very) large bitstring. Doing so is easy enough:
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?
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.