Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 842 Bytes

0B.mdx

File metadata and controls

30 lines (20 loc) · 842 Bytes
fork group
Frontier
Stop and Arithmetic Operations

Index 1 is top of the stack. See PUSH.

Stack input

  1. b: size in byte - 1 of the integer to sign extend.
  2. x: integer value to sign extend.

Stack output

  1. y: integer result of the sign extend.

Examples

* Input Output * * Input Output
1 0 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF * 1 0 0x7F
2 0xFF * 2 0x7F

Reproduce in playground.

Error cases

The state changes done by the current context are reverted in those cases:

  • Not enough gas.
  • Not enough values on the stack.