I am new to solidity. I need to understand the couple of things
- maximum value an int and unit can store ?
- does maximum values stored in int and uint are same ?
uintis short for
uint256, so it can store 2^256 values - because it's unsigned the maximum value is 2^256-1 (zero needs one space). What is the maximum input value for function uint256 parameter?
intis short for
int256and it can store the same amount of values - because it's signed the maximum (positive) value is 2^256 / 2 - 1.
So the maximum values of
int are not the same. They have the same amount of values but
int needs to store values also for negative numbers.
You can find more details at: Max/min values of standard data types