File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ impl Float for f32 {
38
38
unsafe { mem:: transmute ( a) }
39
39
}
40
40
fn normalize ( significand : Self :: Int ) -> ( Self :: Int , Self :: Int ) {
41
- let shift = Self :: Int :: leading_zeros ( significand )
42
- . wrapping_sub ( Self :: Int :: leading_zeros ( 1 << Self :: significand_bits ( ) ) ) ;
41
+ let shift = significand . leading_zeros ( )
42
+ . wrapping_sub ( ( 1u32 << Self :: significand_bits ( ) ) . leading_zeros ( ) ) ;
43
43
( 1u32 . wrapping_sub ( shift as Self :: Int ) , significand << shift as Self :: Int )
44
44
}
45
45
}
@@ -58,8 +58,8 @@ impl Float for f64 {
58
58
unsafe { mem:: transmute ( a) }
59
59
}
60
60
fn normalize ( significand : Self :: Int ) -> ( Self :: Int , Self :: Int ) {
61
- let shift = Self :: Int :: leading_zeros ( significand )
62
- . wrapping_sub ( Self :: Int :: leading_zeros ( 1 << Self :: significand_bits ( ) ) ) ;
61
+ let shift = significand . leading_zeros ( )
62
+ . wrapping_sub ( ( 1u64 << Self :: significand_bits ( ) ) . leading_zeros ( ) ) ;
63
63
( 1u64 . wrapping_sub ( shift as Self :: Int ) , significand << shift as Self :: Int )
64
64
}
65
65
}
You can’t perform that action at this time.
0 commit comments