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