C#位运算符随着INTS [英] C# Bitwise Operator With Ints
本文介绍了C#位运算符随着INTS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是什么前pression实际上意味着??
What does this expression actually mean??
请注意 - x和y瓦尔只是采样值
Note - the x and y vars are just sample values.
int x = 3;
int y = 1;
if ((x & y) !=0)
我继承了codeBase的,我不加快速度位运算符。我看过了,但我还是失去了一些东西。救命啊!
I inherited a codebase and am not up to speed on bitwise operators. I have read up, but am still missing something. Help!
推荐答案
这是比较中的每个值的位。它返回了在两个号码设置任何位。
It's comparing the bits in each value. It returns any bits that are set in both numbers.
在您的例子:
3: 0011
1: 0001
3 & 1: 0001
这篇关于C#位运算符随着INTS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文