Numberick
Numberick copied to clipboard
Wrapping unsigned binary integer subtraction
NBKUnsignedInteger already requires recoverable unsigned subtraction (#34):
func subtractingReportingOverflow(_ other: Self) -> PVO<Self>
mutating func subtractReportingOverflow(_ other: Self) -> Bool
@_disfavoredOverload func subtractingReportingOverflow(_ other: Digit) -> PVO<Self>
@_disfavoredOverload mutating func subtractReportingOverflow(_ other: Digit) -> Bool
These have well-defined 2's complement semantics. How about conveniences?
static func &- (lhs: Self, rhs: Self) -> Self
static func &-=(lhs: inout Self, rhs: Self)
@_disfavoredOverload static func &- (lhs: Self, rhs: Digit) -> Self
@_disfavoredOverload static func &-=(lhs: inout Self, rhs: Digit)