Created
March 29, 2023 09:38
-
-
Save KolevDarko/f55ae400d4b415e63ab7401d57565ec6 to your computer and use it in GitHub Desktop.
Yul check max
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getMax(uint256 x, uint256 y) public pure returns (uint256 ret) { | |
assembly { | |
if lt(x, y) { | |
ret := y | |
} | |
if iszero(lt(x, y)) { | |
ret := x | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment