Operator

+(_:)

Returns the given number unchanged.

Declaration

prefix static func + (x: Float) -> Float

Return Value

The given argument without any changes.

Discussion

You can use the unary plus operator (+) to provide symmetry in your code for positive numbers when also using the unary minus operator.

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

See Also

Negation

static func - (Float) -> Float

Calculates the additive inverse of a value.

static func - (Float) -> Float

Returns the additive inverse of the specified value.