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
The code generated for black_box(f32::NAN) as u64/u128 converts it to some junk, but correct result is 0. This happens only with f32::NAN and only when converted to u64/u128. Conversion into i64/i128 works fine, as well as conversions intou8, i8, ... u32,i32.
Activity
antoyo commentedon Feb 1, 2022
This is because gcc gives a negative NAN for
0.0 / 0.0.Does Rust define that the sign of NAN should be positive?
Possibly relevant: rust-lang/rust#81261
RalfJung commentedon Feb 20, 2022
rust-lang/rust#55131 also seems very relevant.