You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default implementation of isMultiple(of:) on BinaryInteger
In order to provide source compatibility with existing user types conforming to BinaryInteger, we want to have a default implementation available. It's somewhat difficult to provide a good default implementation that correctly handles arbitrary non-symmetrical ranges in the face of negative divisors, so fall back on testing divisibility of the magnitudes, which avoids the problem.
On the plus side, this default implementation works fine for types conforming to UnsignedInteger, which lets us move the FixedWidthInteger implementation down to FixedWidthInteger & SignedInteger, and simplify it in the process.
0 commit comments