K-098 bitnot
原文:returns the bitwise inverse of the number
中文:將數值轉化為二進位後執行NOT運算,再轉回十進位制並回報。
格式:%bitnot(v1)
範例:%bitand(5)
NOT運算是進行數值反轉,將1轉為0,將0轉為1。與bitand、bitor、bitxor
不同之處在於,它反轉的字元長度有32位。如果是5的二進位not運算,只寫出
0101無法得到與電腦not運算相同的結果,必須用:
00000000000000000000000000000101來反轉,反轉後得到:
11111111111111111111111111111010
轉換為十進位後得結果為-6。