From 36eed6691150b1585435b9fb9854fd63efa43983 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 12 Nov 2022 23:48:59 +0100 Subject: [PATCH] 5000: Fix complaints of the markdown linter --- EIPS/eip-5000.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EIPS/eip-5000.md b/EIPS/eip-5000.md index 6986c7c7a0c1bb..26804d486a18b9 100644 --- a/EIPS/eip-5000.md +++ b/EIPS/eip-5000.md @@ -41,6 +41,7 @@ def muldiv(x, y, z): else: return ((x * y) // z) % (2**256) ``` + The cost of the instruction is 8 gas (aka `mid`), the same as for `addmod` and `mulmod`. ## Rationale @@ -50,9 +51,11 @@ The cost of the instruction is 8 gas (aka `mid`), the same as for `addmod` and ` All the arithmetic instructions in EVM handle division or modulo 0 specially: the instructions return 0. We have decided to break consistency in order to provide a flexible opcode, which can be used to detect wrapping behaviour. Alternate options include: + - Returning a flag for wrapping - Returning two stack items, higher and lower order bits - Compute the higher order 256 bits in EVM: + ```solidity /// Returns `hi` such that `x × y = hi × 2**256 + mul(x, y)` function hob(uint x, uint y) returns (uint hi) {