OP_0NOTEQUAL - Testing for Non-Zero
From TeachMeBitcoin, the free encyclopedia
Reading time: 1 min
6. OP_0NOTEQUAL — Testing for Non-Zero
Opcode Reference
Opcode: OP_0NOTEQUAL
Hex: 0x92
Decimal: 146
Input: a
Output: 0 if a == 0, else 1
Overview
OP_0NOTEQUAL is essentially the boolean identity function for numeric values. It returns 1 if the input is non-zero, and 0 if the input is zero. It is the logical complement of OP_NOT.
Truth Table
``` Input | Output
☕ Help support TeachMeBitcoin
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:
Ethereum:
0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin:
bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana:
4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J