Open
Description
I tried this code:
pub fn foo() -> f32 {
0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffffu128 as f32
}
I expected to see this happen: Saturating to f32::INFINITY
Instead, this happened: 9223372000000000000.0 is returned
Another case is
pub fn foo() -> f32 {
1<an absolutely huge amount of zeros>u128 as f32
}
which should give an out of range error, but returns 0.0.
Meta
- What version of Rust GCC were you using, git sha if possible: The current version at godbolt.