fork | group |
---|---|
Frontier |
Stop and Arithmetic Operations |
Index 1 is top of the stack. See PUSH.
All intermediate calculations of this operation are not subject to the 2256 modulo.
a
: first integer value to add.b
: second integer value to add.N
: integer denominator.
(a + b) % N
: integer result of the addition followed by a modulo. If the denominator is 0, the result will be 0.
* | Input | Output | * | * | Input | Output |
---|---|---|---|---|---|---|
1 |
10 |
4 |
* | 1 |
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF |
1 |
2 |
10 |
* | 2 |
2 |
||
3 |
8 |
* | 2 |
2 |
The state changes done by the current context are reverted in those cases:
- Not enough gas.
- Not enough values on the stack.