Skip to content

Commit ce122db

Browse files
committed
Clarify the documentation of SignedNumeric.
Previously we said that a type conforming to SignedNumeric allows positive and negative values, but that's nonsense. A type conforms to signed numeric if it has a negate() operation; it doesn't even have to have a notion of positive or negative values (for examples, see complex numbers, quaternions, integers mod n, etc).
1 parent a788461 commit ce122db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/Integers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public protocol Numeric: AdditiveArithmetic, ExpressibleByIntegerLiteral {
258258
static func *=(lhs: inout Self, rhs: Self)
259259
}
260260

261-
/// A type that can represent both positive and negative values.
261+
/// A numeric type with a negation operation.
262262
///
263263
/// The `SignedNumeric` protocol extends the operations defined by the
264264
/// `Numeric` protocol to include a value's additive inverse.

0 commit comments

Comments
 (0)