negate()
Replaces this value with its additive inverse.
Declaration
mutating func negate()Discussion
The result is always exact. This example uses the negate() method to negate the value of the variable x:
var x = 21.5
x.negate()
// x == -21.5Replaces this value with its additive inverse.
mutating func negate()The result is always exact. This example uses the negate() method to negate the value of the variable x:
var x = 21.5
x.negate()
// x == -21.5