Operator 演算子

/(_:_:)

Returns the quotient of dividing the first value by the second, rounded to a representable value. 最初の値を2番目の値で除算した商を返します、表現可能な値に丸められます。

Declaration 宣言

static func / (lhs: Float, rhs: Float) -> Float

Parameters パラメータ

lhs

The value to divide. 除算することになる値。

rhs

The value to divide lhs by. この値でlhsを除算します。

Discussion 解説

The division operator (/) calculates the quotient of the division if rhs is nonzero. If rhs is zero, the result of the division is infinity, with the sign of the result matching the sign of lhs. 除算演算子(/)は、rhsが非ゼロならばその除算の商を計算します。rhsがゼロならば、除算の結果は無限大です、結果の符号はlhsの符号と一致します。


let x = 16.875
let y = x / 2.25
// y == 7.5


let z = x / 0
// z.isInfinite == true

The / operator implements the division operation defined by the IEEE 754 specification. /演算子は、IEEE 754 仕様によって定義される除算演算子を実装します。

Relationships 関係

From Protocol 由来プロトコル

See Also 参照

Arithmetic 算術