MathF.Pow(Single, Single) 方法

定义

返回指定数字的指定次幂。Returns a specified number raised to the specified power.

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

参数

x
Single

要乘幂的单精度浮点数。A single-precision floating-point number to be raised to a power.

y
Single

指定幂的单精度浮点数。A single-precision floating-point number that specifies a power.

返回

数字 xy 次幂。The number x raised to the power y.

注解

下表指示为xy参数指定了各种值或值范围时的返回值。The following table indicates the return value when various values or ranges of values are specified for the x and y parameters. 有关详细信息,请参阅Single.PositiveInfinitySingle.NegativeInfinitySingle.NaNFor more information, see Single.PositiveInfinity, Single.NegativeInfinity, and Single.NaN.

参数Parameters 返回值Return value
xy 。 = NaNx or y = NaN. NaN
x= 除之外NaN的任何值;y = 0。x = Any value except NaN; y = 0. 11
x = NegativeInfinity; y < 0.x = NegativeInfinity; y < 0. 00
x = NegativeInfinity;y为正奇数整数。x = NegativeInfinity; y is a positive odd integer. NegativeInfinity
x = NegativeInfinity;y为正值, 但不是奇数。x = NegativeInfinity; y is positive but not an odd integer. PositiveInfinity
x< 0 但不NegativeInfinity是;不是整数、 NegativeInfinityPositiveInfinityyx < 0 but not NegativeInfinity; y is not an integer, NegativeInfinity, or PositiveInfinity. NaN
x=-1;y 或。PositiveInfinity = NegativeInfinityx = -1; y = NegativeInfinity or PositiveInfinity. NaN
-1 < x < 1; y = NegativeInfinity.-1 < x < 1; y = NegativeInfinity. PositiveInfinity
-1 < x < 1; y = PositiveInfinity.-1 < x < 1; y = PositiveInfinity. 00
x<-1 或x > 1;y = NegativeInfinity.x < -1 or x > 1; y = NegativeInfinity. 00
x<-1 或x > 1;y = PositiveInfinity.x < -1 or x > 1; y = PositiveInfinity. PositiveInfinity
x = 0; y < 0.x = 0; y < 0. PositiveInfinity
x = 0; y > 0.x = 0; y > 0. 00
x= 1;为除以外NaN的任何值。 yx = 1; y is any value except NaN. 11
x = PositiveInfinity; y < 0.x = PositiveInfinity; y < 0. 00
x = PositiveInfinity; y > 0.x = PositiveInfinity; y > 0. PositiveInfinity

适用于

另请参阅