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> {
1464
1464
}
1465
1465
1466
1466
trait Bits {
1467
- fn bits ( & self ) -> usize ;
1467
+ fn bits ( & self ) -> u64 ;
1468
1468
}
1469
1469
1470
1470
#[ cfg( feature = "bigint" ) ]
1471
1471
impl Bits for BigInt {
1472
- fn bits ( & self ) -> usize {
1472
+ fn bits ( & self ) -> u64 {
1473
1473
self . bits ( )
1474
1474
}
1475
1475
}
1476
1476
1477
1477
impl 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 ( )
1480
1480
}
1481
1481
}
1482
1482
@@ -1526,11 +1526,11 @@ fn ratio_to_f64<T: Bits + Clone + Integer + Signed + ShlAssign<usize> + ToPrimit
1526
1526
1527
1527
// Filter out overflows and underflows. After this step, the signed difference fits in an
1528
1528
// 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 {
1530
1530
return core:: f64:: INFINITY * flo_sign;
1531
1531
}
1532
1532
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
1534
1534
{
1535
1535
return 0.0 * flo_sign;
1536
1536
}
You can’t perform that action at this time.
0 commit comments