f32 as u32 saturates in rust, using to_int_unchecked wasn't currently
saturating on x86, but it's conceivable that it might. Go the long way
around by converting first to i32 and then to u32 in order to avoid the
possibility.
// Range reduction.
let r = (a + a).round();
- let i: u32 = unsafe { r.to_int_unchecked() };
+ let i = unsafe { r.to_int_unchecked::<i32>() } as u32;
let r = r.mul_add(-0.5, a);
let sx = (i >> 1) << 31;
// Range reduction.
let r = (a + a).round();
- let i: u32 = unsafe { r.to_int_unchecked() };
+ let i = unsafe { r.to_int_unchecked::<i32>() } as u32;
let r = r.mul_add(-0.5, a);
let e = if i.wrapping_add(1) & 2 != 0 {