Open nobel-sh opened 1 week ago
The ! operator produces unexpected results.
!
fn main(){ let a: i32 = 5; let b = !a; // expected -6 gccrs gives 0. }
Godbolt: https://godbolt.org/z/cKPPz1bYc
I'm not entirely sure, but it seems that the operator is interpreting the least significant bit of the number as a boolean value and complementing it.
The
!
operator produces unexpected results.Godbolt: https://godbolt.org/z/cKPPz1bYc