View Source BitcoinLib.Script.Opcodes.Arithmetic.Negate (BitcoinLib v0.4.7)

Based on https://en.bitcoin.it/wiki/Script

Word OP_NEGATE Opcode 143 Hex 0x8f Input in Output out The sign of the input is flipped.

Link to this section Summary

Functions

Returns <<0x8f>>

The sign of the input is flipped.

v()

Returns 0x8f

Link to this section Types

@type t() :: BitcoinLib.Script.Opcodes.Arithmetic.Negate

Link to this section Functions

@spec encode() :: <<_::8>>

Returns <<0x8f>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.Arithmetic.Negate.encode()
<<0x8f>>
@spec execute(t(), list()) :: {:ok, list()}

The sign of the input is flipped.

examples

Examples

iex> BitcoinLib.Script.Opcodes.Arithmetic.Negate.execute(
...>  %BitcoinLib.Script.Opcodes.Arithmetic.Negate{},
...>  [2, 3, 1]
...> )
{:ok, [-2, 3, 1]}
@spec v() :: 143

Returns 0x8f

examples

Examples

iex> BitcoinLib.Script.Opcodes.Arithmetic.Negate.v()
0x8f