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 負にする