Timeline for Performance and Gas Implications: uint vs int in Solidity Memory Variables
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 11, 2023 at 4:51 | comment | added | Lejdi Prifti | Take it to a plagarize service and check if it is done with ChatGPT. | |
Sep 11, 2023 at 2:40 | comment | added | Ismael♦ | Please, do not use AI tools to answer questions. | |
Sep 10, 2023 at 21:51 | comment | added | Maka | Ye both answers are plagiarised GPT responses posted at the same time, should be removed. | |
Sep 10, 2023 at 13:58 | comment | added | MShakeG |
A uint256 allows for the range [0, 2^256 - 1] , in int256 1 bit is to indicate sign bit(+/-) and the remaining 255 bits represent the unsigned part(absolute value) which can give you a range of 2^255 values so for an int256 the negative range is [-2^255, -1] and the positive range is [0, 2^255 -1]
|
|
Sep 9, 2023 at 21:25 | comment | added | Lejdi Prifti | No, it changes only with 1 bit to represent the sign, negative or positive which is not quite considerable as a cost. | |
Sep 9, 2023 at 18:14 | comment | added | Eugene1111 | also the answers seems to be the chatGpt response hahaah | |
Sep 9, 2023 at 18:12 | comment | added | Eugene1111 | how can both types be stored in 256 bits, logically the int should require 2 times bigger storage space?:) | |
S Sep 9, 2023 at 9:39 | review | First answers | |||
Sep 9, 2023 at 11:18 | |||||
S Sep 9, 2023 at 9:39 | history | answered | Lejdi Prifti | CC BY-SA 4.0 |