Created
July 31, 2022 20:09
-
-
Save leonardoalt/52693c9681faed3ddd60e96eed84b877 to your computer and use it in GitHub Desktop.
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 factorial_Yul_For(uint256 x) public pure returns(uint256){ | |
assembly{ | |
let result := 1 | |
for {} iszero(iszero(x)) { x := sub(x, 1)} { | |
result := mul(result, x) | |
} | |
mstore(0,result) | |
return(0,0x20) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment