A floating-point value. ある浮動小数点値。
maximumMagnitude(_:_:)
Availability
- macOS 10.10+
- Mac Catalyst 13.0+
- Xcode 9.0+
Technology
- Swift Standard Library Swift標準ライブラリ
Declaration 宣言
Parameters パラメータ
x
y
Another floating-point value. もう1つの浮動小数点値。
Return Value 戻り値
Whichever of x
or y
has greater magnitude, or whichever is a number if the other is NaN.
x
とy
のどちらがより大きい規模を持つか、または他方がNaNならば数である方。
Discussion 解説
This method returns the value with greater magnitude of the two given values, preserving order and eliminating NaN when possible. For two values x
and y
, the result of maximum
is x
if x
, y
if 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つの値x
とy
に対して、maximum
の結果は、x
ならばx
、x
ならばy
、または他のものがクワイエットNaNならばx
かy
どちらか数である方です。x
とy
の両方がNaN、またはx
またはy
のどちらかがシグナルNaNならば、結果はNaNです。
Double.maximumMagnitude(10.0, -25.0)
// -25.0
Double.maximumMagnitude(10.0, .nan)
// 10.0
Double.maximumMagnitude(.nan, -25.0)
// -25.0
Double.maximumMagnitude(.nan, .nan)
// nan
The maximum
method implements the max
operation defined by the IEEE 754 specification.
maximum
メソッドは、IEEE 754仕様によって定義されるmax
演算を実装します。
Note 注意
This documentation comment was inherited from Floating
.
この文書化コメントは、Floating
から引き継がれました。