K-095 bitand
原文:returns the bitwise AND of the two numbers
中文:將兩個數值轉化為二進位後執行AND運算,再轉回十進位制並回報。
格式:%bitand(v1,v2)
範例:%bitand(5,6)
5的二進位數值為0101,6則是0110。
二進位的AND運算規則:
v1 v2 結果
0 0 0
0 1 0
1 1 1
1 0 0
本例為:
5 6 結果
0 0 0
1 1 1
0 1 0
1 0 0
二進位0100轉換為十進位後得結果為4。