Single.MaxNumber(Single, Single) 方法

定義

比較兩個值與計算,如果輸入為 NaN ,則會傳回另一個值。

public:
 static float MaxNumber(float x, float y) = System::Numerics::INumber<float>::MaxNumber;
public static float MaxNumber (float x, float y);
static member MaxNumber : single * single -> single
Public Shared Function MaxNumber (x As Single, y As Single) As Single

參數

x
Single

要與 y 比較的值。

y
Single

要與 x 比較的值。

傳回

x 如果大於 ,則為 y ,否則為 y

實作

備註

針對 IFloatingPoint<TSelf> 這個方法,符合 IEEE 754:2019 maximumNumber 函式。 這需要 NaN 輸入不會傳播回呼叫端,且 -0.0 要視為小於 +0.0

適用於