MathF.Max(Single, Single) 方法

定义

返回两个单精度浮点数字中较大的一个。Returns the larger of two single-precision floating-point numbers.

public:
 static float Max(float x, float y);
public static float Max (float x, float y);
static member Max : single * single -> single
Public Shared Function Max (x As Single, y As Single) As Single

参数

x
Single

要比较的两个单精度浮点数中的第一个。The first of two single-precision floating-point numbers to compare.

y
Single

要比较的两个单精度浮点数中的第二个。The second of two single-precision floating-point numbers to compare.

返回

xy 参数中较大的一个。Parameter x or y, whichever is larger. 如果 xy 或者 xy 都等于 NaN,则返回 NaNIf x, or y, or both x and y are equal to NaN, NaN is returned.

适用于