Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.1 KB

1D.mdx

File metadata and controls

39 lines (26 loc) · 1.1 KB
fork group
Constantinople
Comparison & Bitwise Logic Operations

Index 1 is top of the stack. See PUSH.

Notes

Shift the bits towards the least significant one. The bits moved before the first one are discarded, the new bits are set to 0 if the previous most significant bit was 0, otherwise the new bits are set to 1.

Stack input

  1. shift: number of bits to shift to the right.
  2. value: integer to shift.

Stack output

  1. value >> shift: the shifted value.

Examples

* Input Output
1 1 1
2 2
* Input Output
1 4 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
2 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0

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.