Content pfp
Content
@
https://onchainsummer.xyz
0 reply
26 recasts
26 reactions

Jeffrey Scholz pfp
Jeffrey Scholz
@jeffs
Check if a number is even or odd in Solidity: Don’t do `n % 2 == 0` Do `n & uint256(1) == 0` If the final bit is zero, then the number is even. The second method is cheaper.
0 reply
0 recast
5 reactions