-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solidity::util::formatNumberReadable signed integer support #9601
Comments
Probably the same issue: #9479 (comment) |
Hi, i will try to work on it. |
Hi, just to clarify. Should the number |
In my opinion, if that's the current behavior in the positive case then doing a similar thing in the negative one is fine as well. It's still some improvement. But, it would be best to just change it in both cases to Also note that after implementing it you should update expectations in tests because that's where these numbers are used currently. But don't do it manually - you can just run |
Actually, i think it is technically possible to move from I just was not sure whether to follow the current implementation or to do it in the way it was written in the task, i.e. which number representation to take as a basiс representation. But i understand now. |
if this problem does not block anything. i am still working on it. it took a bit more than expected but guess it is only due to personal reasons. |
There's no hurry. It would be pretty helpful, especially in cases like #10776 (comment) but fixing this is not a priority right now so you can work on it at your own pace. |
@Neyromancer Are you still working on it? Do you need any help? |
If this issue hasn't been resolved yet, I am interested to work on it. |
It's up for the taking. But I'd recommend the other issue you commented on (#9926) because it's more visible to users and should be more satisfying to fix. |
Are signed integers implemented in the compiler using u256 as well, or is there another datatype for representing signed integers? |
We have |
But to be clear, this function is not limited to |
It seems that signed integer was not supported in formatNumberReadable because bigint doesn't support the right shift operator. Should i replace the right shift operators with division for all types of integers, or just use division for bigint in a separate condition and keep the right shift operator for the rest of the integer types? |
@nikola-matic @matheusaaguiar What's the status here? Did these merged PRs fix this issue or is there somehing left to do? |
Should be, but @matheusaaguiar spent a lot more time on this, so let's wait for him to chime in. |
The mentioned PRs have fixed this fixed this issue. |
Currently that function does not support signed values, causing, for example:
Warning 3944: (110-115): Underflow (resulting value less than -57896044618658097711785492504343953926634992332820282019728792003956564819968) happens here
.That number is actually
-2**255
, so it could be better formatted.The text was updated successfully, but these errors were encountered: