Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 780 Bytes

06.mdx

File metadata and controls

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

Index 1 is top of the stack. See PUSH.

Stack input

  1. a: integer numerator.
  2. b: integer denominator.

Stack output

  1. a % b: integer result of the integer modulo. If the denominator is 0, the result will be 0.

Examples

* Input Output * * Input Output
1 10 1 * 1 17 2
2 3 * 2 5

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.