Operator: prefix +

operator prefix + { associativity precedence }

Declarations

prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

BinaryFloatingPoint, Numeric
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger
prefix func +(_: Self)

Returns the given number unchanged.

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

Returns: The given argument without any changes.

Declaration

prefix func +(x: Self) -> Self

Declared In

FixedWidthInteger