@@ -42,7 +42,7 @@ mod int_to_float {
4242 fn m_adj < F : Float > ( m_base : F :: Int , dropped_bits : F :: Int ) -> F :: Int {
4343 // Branchlessly extract a `1` if rounding up should happen, 0 otherwise
4444 // This accounts for rounding to even.
45- let adj = ( dropped_bits - ( dropped_bits >> ( F :: BITS - 1 ) & !m_base) ) >> ( F :: BITS - 1 ) ;
45+ let adj = ( dropped_bits - ( ( dropped_bits >> ( F :: BITS - 1 ) ) & !m_base) ) >> ( F :: BITS - 1 ) ;
4646
4747 // Add one when we need to round up. Break ties to even.
4848 m_base + adj
@@ -129,7 +129,7 @@ mod int_to_float {
129129 let m_base: u32 = ( i_m >> shift_f_lt_i :: < u64 , f32 > ( ) ) as u32 ;
130130 // The entire lower half of `i` will be truncated (masked portion), plus the
131131 // next `EXP_BITS` bits.
132- let adj = ( i_m >> f32:: EXP_BITS | i_m & 0xFFFF ) as u32 ;
132+ let adj = ( ( i_m >> f32:: EXP_BITS ) | i_m & 0xFFFF ) as u32 ;
133133 let m = m_adj :: < f32 > ( m_base, adj) ;
134134 let e = if i == 0 { 0 } else { exp :: < u64 , f32 > ( n) - 1 } ;
135135 repr :: < f32 > ( e, m)
@@ -187,7 +187,7 @@ mod int_to_float {
187187 let m_base: u64 = ( i_m >> shift_f_lt_i :: < u128 , f64 > ( ) ) as u64 ;
188188 // The entire lower half of `i` will be truncated (masked portion), plus the
189189 // next `EXP_BITS` bits.
190- let adj = ( i_m >> f64:: EXP_BITS | i_m & 0xFFFF_FFFF ) as u64 ;
190+ let adj = ( ( i_m >> f64:: EXP_BITS ) | i_m & 0xFFFF_FFFF ) as u64 ;
191191 let m = m_adj :: < f64 > ( m_base, adj) ;
192192 let e = if i == 0 { 0 } else { exp :: < u128 , f64 > ( n) - 1 } ;
193193 repr :: < f64 > ( e, m)
@@ -377,7 +377,7 @@ where
377377 } ;
378378
379379 // Set the implicit 1-bit.
380- let m: I :: UnsignedInt = I :: UnsignedInt :: ONE << ( I :: BITS - 1 ) | m_base;
380+ let m: I :: UnsignedInt = ( I :: UnsignedInt :: ONE << ( I :: BITS - 1 ) ) | m_base;
381381
382382 // Shift based on the exponent and bias.
383383 let s: u32 = ( foobar) - u32:: cast_from ( fbits >> F :: SIG_BITS ) ;
0 commit comments