i have an array of 1s and 0s to represent a binary number. i would like to be able to manipulate the array (or maybe create a new one if neccesary?) which will represent the one's complement of the binary number.
can anybody help me with this?
i have an array of 1s and 0s to represent a binary number. i would like to be able to manipulate the array (or maybe create a new one if neccesary?) which will represent the one's complement of the binary number.
can anybody help me with this?
the NOT operator? I don't follow..lol
Well, what do you think the ones' complement of a binary number is, then?
Is the one's complement of a binary number just the bits flipped ? i.e 1 becomes 0 and 0 becomes 1?
I thought it was the '~' operator.
Yep "~" is the one's complement while "!" is for logical negation.