Returns the additive inverse of the specified value.

  • Required.

static func - (operand: Self) -> Self


The additive inverse of this value.


The negation operator (prefix -) returns the additive inverse of its argument.

let x = 21
let y = -x
// y == -21

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.

let z = -Int8.min
// Overflow error