If the user wants to push -10 onto the stack.
Would I do "10 OP_NEGATE" ?
Or could I convert it to the hex value by doing 0x80 + 10 = 0X8A ?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityIf the user wants to push -10 onto the stack.
Would I do "10 OP_NEGATE" ?
Or could I convert it to the hex value by doing 0x80 + 10 = 0X8A ?
Both will work. OP_NEGATE simply XORs with 0x80, so you can also directly push the result.