File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1464,19 +1464,19 @@ impl<T: Clone + Integer + ToPrimitive + ToBigInt> ToPrimitive for Ratio<T> {
14641464}
14651465
14661466trait Bits {
1467- fn bits ( & self ) -> usize ;
1467+ fn bits ( & self ) -> u64 ;
14681468}
14691469
14701470#[ cfg( feature = "bigint" ) ]
14711471impl Bits for BigInt {
1472- fn bits ( & self ) -> usize {
1472+ fn bits ( & self ) -> u64 {
14731473 self . bits ( )
14741474 }
14751475}
14761476
14771477impl Bits for i128 {
1478- fn bits ( & self ) -> usize {
1479- ( 128 - self . wrapping_abs ( ) . leading_zeros ( ) ) as usize
1478+ fn bits ( & self ) -> u64 {
1479+ ( 128 - self . wrapping_abs ( ) . leading_zeros ( ) ) . into ( )
14801480 }
14811481}
14821482
@@ -1526,11 +1526,11 @@ fn ratio_to_f64<T: Bits + Clone + Integer + Signed + ShlAssign<usize> + ToPrimit
15261526
15271527 // Filter out overflows and underflows. After this step, the signed difference fits in an
15281528 // isize.
1529- if is_diff_positive && absolute_diff > core:: f64:: MAX_EXP as usize {
1529+ if is_diff_positive && absolute_diff > core:: f64:: MAX_EXP as u64 {
15301530 return core:: f64:: INFINITY * flo_sign;
15311531 }
15321532 if !is_diff_positive
1533- && absolute_diff > -core:: f64:: MIN_EXP as usize + core:: f64:: MANTISSA_DIGITS as usize + 1
1533+ && absolute_diff > -core:: f64:: MIN_EXP as u64 + core:: f64:: MANTISSA_DIGITS as u64 + 1
15341534 {
15351535 return 0.0 * flo_sign;
15361536 }
You can’t perform that action at this time.
0 commit comments