Created
October 6, 2021 09:24
-
-
Save sepisoltani/ea65f7d2e8d2525d232aac0bc9fa0003 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
contract Example{ | |
uint8 a = 5; | |
uint b = 6; | |
// throws an error because a * b returns a uint, not uint8: | |
uint8 c = a * b; | |
// we have to typecast b as a uint8 to make it work: | |
uint8 c = a * uint8(b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment