I think that it is very good article, too! In the good old days the bitwise operators were part of our everyday life. Now they are used only from the good devs which still think for performance.
P.S. Why not adding some words about <> just to cover the whole topic?
Thanks again!
it is not helpful as I am finding the operator for XNOR operation.
I encrypt the password using XOR operator, now i want to decrypt it. What is the process to achieve this?
Brad, if you XOR something, just XOR it again to get back your original value.
i want the logic as how to write bitwise xor like
for 101 we get 0 by doing bitwise xor
for 100 we get 1 by doing bitwise xor
A GOOD STUFF INDEED.I want to add: If one XORs anything twice he will get the actual number again.That is how one can use it to encrypt and decrypt.
If we want to get 0 for 101 and 1 for 100,it can be assumed that only the LSB is used for XOR operation,now if we XOR the number with 1,i.e.001 then we get the desired output.
this article really helps
My Thanks to the author. This article is short but very, very clear:-)
i don't understand this article.
for example:
var a = 1;
var b = 2;
if (a == b ) {
//do sothing.
}
if i use bitwise operators, i will write:
if (a & b == a) {
//do sothing
}
is it true ? how about other operators ?
Please help me.
Cool use of the ~ operator is the binary search method in the List class. It returns a negative integer when it can't find the specified item. This negative integer becomes the correct insertion point to keep the list sorted, when you apply the ~ operator.
Pls help me..
I have to compute for binary Not AND(NAND), NOR and XNOR(Exclusive NOR)in C#. operator ~ and ! are not support for NAND, NOR and XNOR. so pls tell me how to ..
NAND (Not AND)
0 NAN 0 = 1
0 NAN 1 = 1
1 NAN 0 = 1
1 NAN 1 = 0
NOR (Not OR)
0 NOR 0 = 1
0 NOR 1 = 0
1 NOR 0 = 0
1 NOR 1 = 0
Thanks, very well written and easy to understand post.
Waw gr8 examples,
It's really helpfull for me.
Thankx
Exactly what I was looking for. Thanks!
thanks..........
u hav done a great job....
i was trying to get it form months.........
thanks a lot>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Very impressive. Short, but to the point. I skipped class yesterday an apparently they spent the whole hour going over c# bitwise operators. Took ten min of reading this article to catch up lol.
Thanks for writing such an understanding article on Bitwize
really helpful, thx. some tricks with ~, good explained. As asked: what's one's complement?