Last active
March 3, 2023 14:16
-
-
Save veridelisi/93e112d3894be2428d0ee57aa935264d to your computer and use it in GitHub Desktop.
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.19; | |
contract Shifting { | |
function right(uint256 x) public pure returns(uint256 y) { | |
return y = x >> 2; | |
} | |
function left(uint256 x) public pure returns(uint256 y) { | |
return y= x << 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment