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 @@ -1672,12 +1672,12 @@ extension BinaryInteger {
1672
1672
if Self . isSigned {
1673
1673
return lhs. bitWidth > rhs. bitWidth ? // (1)
1674
1674
lhs == Self ( truncatingIfNeeded: rhs) :
1675
- lhs < ( 0 as Self ) ? false : Other ( truncatingIfNeeded: lhs) == rhs // (2)
1675
+ ( lhs >= ( 0 as Self ) && Other ( truncatingIfNeeded: lhs) == rhs) // (2)
1676
1676
}
1677
1677
// Analogous reasoning applies if `Other` is signed but `Self` is not.
1678
1678
return lhs. bitWidth < rhs. bitWidth ?
1679
1679
Other ( truncatingIfNeeded: lhs) == rhs :
1680
- rhs < ( 0 as Other ) ? false : lhs == Self ( truncatingIfNeeded: rhs)
1680
+ ( rhs >= ( 0 as Other ) && lhs == Self ( truncatingIfNeeded: rhs) )
1681
1681
}
1682
1682
1683
1683
/// Returns a Boolean value indicating whether the two given values are not
@@ -1731,12 +1731,12 @@ extension BinaryInteger {
1731
1731
if Self . isSigned {
1732
1732
return lhs. bitWidth > rhs. bitWidth ? // (1)
1733
1733
lhs < Self ( truncatingIfNeeded: rhs) :
1734
- lhs < ( 0 as Self ) ? true : Other ( truncatingIfNeeded: lhs) < rhs // (2)
1734
+ ( lhs < ( 0 as Self ) || Other ( truncatingIfNeeded: lhs) < rhs) // (2)
1735
1735
}
1736
1736
// Analogous reasoning applies if `Other` is signed but `Self` is not.
1737
1737
return lhs. bitWidth < rhs. bitWidth ?
1738
1738
Other ( truncatingIfNeeded: lhs) < rhs :
1739
- rhs < ( 0 as Other ) ? false : lhs < Self ( truncatingIfNeeded: rhs)
1739
+ ( rhs > ( 0 as Other ) && lhs < Self ( truncatingIfNeeded: rhs) )
1740
1740
}
1741
1741
1742
1742
/// Returns a Boolean value indicating whether the value of the first
You can’t perform that action at this time.
0 commit comments