选择123& 789是什么意思 [英] what the means of select 123&789
本文介绍了选择123& 789是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我正在做
if i am doing
Statement Result
select 1&1 1
select 1&2 0
select 1&3 1
select 1&4 0
select 123&1 1
select 123&7 3
select 1234&789 16
select 789&1234 16
select 78&12346 10
select 12345&678 32
意味着什么?请帮助我.. !!
Means?? Please help me..!!
推荐答案
&
是明智的因此1& 2(十进制) )== 01和10(二进制)= 0等。
&
is the bit wise AND so 1&2 (decimal) == 01 and 10 (binary) = 0 etc.
&是一个二进制AND运算符:它组合了操作数中的位,所以如果两个操作数中的位是1,那么结果是相同的位1 - 另一方面它是零。
所以,每个位:
"&" is a binary AND operator: it combines bits in the operand, so if the bit is one in both operands, than the result is the same bit one - other wise it is zero.
So, for each bit:
Op1 & Op2 Result
0 0 0
0 1 0
1 0 0
1 1 1
从你的例子中很难看出发生了什么,因为你的所有数字都是十进制的 - 这与实际的比特并不很好。但是......如果你首先将它们翻译成二进制值,那就更明显了:
It's kind hard to see from your example what is going on, because all your numbers are in decimal - which doesn't relate "nicely" to the actual bits. But...if you translate them to binary values first it's more obvious:
Your command Op1 Op2 Result
select 1&1 01 01 1
select 1&2 01 10 0
select 1&3 01 11 1
select 1&4 001 100 0
select 123&1 1111011 0000001 1
select 123&7 1111011 0000111 11
etc.
这篇关于选择123& 789是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文