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

适用于