MathF.Pow(Single, Single) Método

Definición

Devuelve un número especificado elevado a la potencia especificada.

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

Parámetros

x
Single

Número de punto flotante de precisión sencilla que se va a elevar a una potencia.

y
Single

Número de punto flotante de precisión sencilla que especifica una potencia.

Devoluciones

Número x elevado a la potencia y.

Comentarios

En la tabla siguiente se indica el valor devuelto cuando se especifican varios valores o intervalos de valores para los x parámetros y y . Para obtener más información, vea Single.PositiveInfinity, Single.NegativeInfinity y Single.NaN.

x y Valor devuelto
Cualquier valor excepto NaN ±0 1
NaN ±0 1 (NaN en .NET Framework)*
NaN Cualquier valor excepto 0 NaN*
±0 < 0 y un entero impar NegativeInfinity o PositiveInfinity
±0 NegativeInfinity PositiveInfinity
±0 PositiveInfinity +0
±0 > 0 y un entero impar ±0
-1 NegativeInfinity o PositiveInfinity 1
+1 Cualquier valor excepto NaN 1
+1 NaN 1 (NaN en .NET Framework)*
Cualquier valor excepto 1 NaN NaN*
-1 < x < 1 PositiveInfinity +0
< -1 o > 1 PositiveInfinity PositiveInfinity
-1 < x < 1 NegativeInfinity PositiveInfinity
< -1 o > 1 NegativeInfinity +0
PositiveInfinity < 0 +0
PositiveInfinity > 0 PositiveInfinity
NegativeInfinity < 0 e entero finito e impar -0
NegativeInfinity > 0 e entero finito e impar NegativeInfinity
NegativeInfinity < 0 y finito y no un entero impar +0
NegativeInfinity > 0 y finito y no un entero impar PositiveInfinity
±0 < 0 y finito y no un entero impar PositiveInfinity
±0 > 0 y finito y no un entero impar +0
< 0, pero no NegativeInfinity Entero no entero finito NaN

* Estas filas no aparecen en el conjunto completo de reglas para pow según lo definido por el estándar IEEE para Floating-Point aritmética. Se incluyen aquí porque .NET deshabilita las excepciones de punto flotante IEEE 754 y, por tanto, no diferencia entre qNaN (NaN silencioso) y sNaN (señal naN). La especificación IEEE 754 permite esta deshabilitación de excepción.

Este método llama al tiempo de ejecución de C subyacente y el resultado exacto o el intervalo de entrada válido pueden diferir entre diferentes sistemas operativos o arquitecturas.

Se aplica a

Consulte también