You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
Version
ethers = 1.0.0 / 0.17.0 (same problem on old version)
Platform
M1 Mac, as well as x64 linux
Description
Bug? in bit-shifting an negative I256
[short summary of the bug]
When I try to right shift an I256 with 128 i get the wrong result - The result that is shows is 340282366920938463463374607431768090784 but the correct result is -120672
I tried this code:
use ethers::types::I256;
fn main() {
let negativ_number =
I. 256::from_dec_str("-41062328663447644311028663865158126991809745").unwrap();
dbg!(negativ_number >> 128);
{
I expected to see this happen:
-120672
Instead, this happened: [explanation]
340282366920938463463374607431768090784
The text was updated successfully, but these errors were encountered:
Version
ethers = 1.0.0 / 0.17.0 (same problem on old version)
Platform
M1 Mac, as well as x64 linux
Description
Bug? in bit-shifting an negative I256
[short summary of the bug]
When I try to right shift an I256 with 128 i get the wrong result - The result that is shows is 340282366920938463463374607431768090784 but the correct result is -120672
I tried this code:
I expected to see this happen:
![Screen Shot 2022-11-07 at 9 58 26 PM](https://user-images.githubusercontent.com/58805871/200414053-7a63ff32-d3d5-49d1-972e-8b5d4e8c49cb.png)
-120672
Instead, this happened: [explanation]
340282366920938463463374607431768090784
The text was updated successfully, but these errors were encountered: