View Source BitcoinLib.Script.Opcodes.Arithmetic.OneSub (BitcoinLib v0.4.7)
Based on https://en.bitcoin.it/wiki/Script
Word OP_1SUB Opcode 140 Hex 0x8c Input in Output out 1 is subtracted from the input.
Link to this section Summary
Link to this section Types
@type t() :: BitcoinLib.Script.Opcodes.Arithmetic.OneSub
Link to this section Functions
@spec encode() :: <<_::8>>
Returns <<0x8c>>
examples
Examples
iex> BitcoinLib.Script.Opcodes.Arithmetic.OneSub.encode()
<<0x8c>>
b is subtracted from a.
examples
Examples
iex> BitcoinLib.Script.Opcodes.Arithmetic.OneSub.execute(
...> %BitcoinLib.Script.Opcodes.Arithmetic.OneSub{},
...> [7, 3, 1]
...> )
{:ok, [6, 3, 1]}
@spec v() :: 140
Returns 0x8c
examples
Examples
iex> BitcoinLib.Script.Opcodes.Arithmetic.OneSub.v()
0x8c