Returns the additive inverse of the specified value.
SDK
- Xcode 10.0+
Framework
- Swift Standard Library
Declaration
Return Value
The additive inverse of the argument.
Discussion
The negation operator (prefix -
) returns the additive inverse of its argument.
The resulting value must be representable in the same type as the argument. In particular, negating a signed, fixed-width integer type’s minimum results in a value that cannot be represented.