是德科技
直播中

周烜

8年用户 258经验值
私信 关注
[问答]

请问我可以用vee做到这一点吗?

你好,我有两个整数值,想要做第一个值的掩码A = 4128(1000000100000)值B = 8(1000)A AND B = 0值A = 4136(1000000101000)值B = 8(1000)A AND
B =我可以用vee做到这一点吗?Thx

以上来自于谷歌翻译


     以下为原文

  Hello,
i have two integer values and want to do a mask of the first value

value A = 4128 (1000000100000)
value B = 8 (1000)
A AND B = 0

value A = 4136 (1000000101000)
value B = 8 (1000)
A AND B = 1

How can i do this in vee?

Thx  

回帖(1)

周烜

2019-6-13 10:50:17
感谢Mike在VRF:“你可以使用BitAnd(x,y),但你的第二个结果将是8(1000),而不是1,因为真正的掩码结果应该是。如果你想知道第4位是否是
设置(十进制8),你可以使用位(4136,3),它将返回1.“

以上来自于谷歌翻译


     以下为原文

  Thanks to Mike in VRF:

"
You can use BitAnd(x, y), but your 2nd result will be 8 (1000), not 1, as a true mask result should be.
If you want to know if just the 4th bit is set (decimal 8), you can use Bit(4136, 3) and it will return a 1.
"
举报

更多回帖

发帖
×
20
完善资料,
赚取积分