Type Method 型メソッド

minimum(_:_:)

Returns the lesser of the two given values. 2つの与えられた値のより小さい方を返します。

Declaration 宣言

static func minimum(_ x: Float, _ y: Float) -> Float

Parameters パラメータ

x

A floating-point value. ある浮動小数点値。

y

Another floating-point value. もう1つの浮動小数点値。

Return Value 戻り値

The minimum of x and y, or whichever is a number if the other is NaN. xyの最小、または他方がNaNならば数である方。

Discussion 解説

This method returns the minimum of two values, preserving order and eliminating NaN when possible. For two values x and y, the result of minimum(x, y) is x if x <= y, y if y < x, or whichever of x or y is a number if the other is a quiet NaN. If both x and y are NaN, or either x or y is a signaling NaN, the result is NaN. このメソッドは、2つの値のうち最小を返します、可能な場合は桁数の保全およびNaNの排除をします。2つの値xyに対して、minimum(x, y)の結果はx <= yならばxy < xならばy、または他のものがクワイエットNaNならばxyどちらか数である方です。xyの両方がNaN、またはxまたはyのどちらかがシグナルNaNならば、結果はNaNです。


Double.minimum(10.0, -25.0)
// -25.0
Double.minimum(10.0, .nan)
// 10.0
Double.minimum(.nan, -25.0)
// -25.0
Double.minimum(.nan, .nan)
// nan

The minimum method implements the minNum operation defined by the IEEE 754 specification. minimumメソッドはminNum演算を実装します、それはIEEE 754仕様によって定義されます。

See Also 参照

Comparing Values 値の比較