2

I am new to solidity. I need to understand the couple of things

  1. maximum value an int and unit can store ?
  2. does maximum values stored in int and uint are same ?
6
  • An uint is 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?
  • An int is short for int256 and 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 uint and 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.