Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitwise shifting instructions in EVM #215

Merged
merged 12 commits into from
Sep 22, 2017
Prev Previous commit
Next Next commit
Use floor and not udiv/sdiv
  • Loading branch information
axic committed Jul 3, 2017
commit e5ca9196720c2a52134ce922ba80638e40ad5614
4 changes: 2 additions & 2 deletions EIPS/eip-145.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Notes:
The `SHR` instruction (logical shift right) pops 2 values from the stack, `arg1` and `arg2`, and pushes on the stack the first popped value `arg1` shifted to the right by the number of bits in the second popped value `arg2` with zero fill. The result is equal to

```
arg1 udiv 2^arg2
floor(arg1 / 2^arg2)
```

Notes:
Expand All @@ -54,7 +54,7 @@ Notes:
The `SAR` instruction (arithmetic shift right) pops 2 values from the stack, `arg1` and `arg2`, and pushes on the stack the first popped value `arg1` shifted to the right by the number of bits in the second popped value `arg2` with sign extension. The result is equal to

```
arg1 sdiv 2^arg2
floor(arg1 / 2^arg2)
```

Notes:
Expand Down