Opcodes · arithmetic · enabled
OP_DIV (0x96)
Divides a by b, truncating toward zero. Division by zero fails. Re-enabled on BCH in May 2018. Since May 2025 numbers may be up to 10,000 bytes long (BigInt).
Verified
- Stack in → out
- a b → a/b
- Cost
- Base instruction cost 100, plus twice the result length, plus the product of the two input lengths to cover O(n²) work (2025 VM limits).
- Bitcoin status
- Disabled in Bitcoin (BTC)Disabled since 2010; an OP_SUCCESS code in Tapscript.
Example
OP_7 OP_2 OP_DIV OP_3 OP_EQUAL Step through it opcode by opcode in Bitauth IDE, the in-browser BCH VM debugger.