Numberick
Numberick copied to clipboard
No extra `quotientAndRemainder(dividingBy:)` default
I provide three quotientAndRemainder(dividingBy:) defaults in NBKBinaryInteger.swift, which is one more than you'd expect. That's because the core integers do not compile without the where Self == Digit version. I think its an inelegant solution, but I'm not quite sure how to resolve it. If you've got any ideas, let me know.
func quotientAndRemainder(dividingBy other: Self) -> QR<Self, Self> { ... }
func quotientAndRemainder(dividingBy other: Self) -> QR<Self, Self> where Self == Digit { ... }
@_disfavoredOverload func quotientAndRemainder(dividingBy other: Digit) -> QR<Self, Digit> { ... }
I believe this would not be an issue if it were possible to constrain the default digit methods to a scope where Self != Self.Digit.