# Pow(float, float)

> Returns the result of raising f to the power p.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static float Pow(float f, float p)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Base of the exponentiation operation.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Exponent of the exponentiation operation.

### Returns

| Type                                                          | Description                             |
| ------------------------------------------------------------- | --------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | Result of the exponentiation operation. |

### Remarks

The behaviour of exponentiation varies greatly depending on the sign and range of the exponent `p`:

* For real numbers in the range \[1, ∞], the result of exponentiation is equal to the result of multiplying `f` by itself `p` times.
* For fractional numbers in the range (0, 1), the result of exponentiation is equal to the result of computing the n-th root of `f`, with n being 1/`p`.
* For the value 0, you will get the value 1.
* For real numbears in the range \[-∞, 0), the result of exponentiation is equal to the result of diving 1 by the result of raising `f` to the absolute (non-signed) value of `p`.

Additional Resources: [Mathf.Log](/engine/6000.7/script-reference/unityengine/mathf/log.md).

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // Prints Infinity
        Debug.Log(Mathf.Pow(2, Mathf.Infinity));
        // Prints 256
        Debug.Log(Mathf.Pow(2, 8));
        // Prints 2
        Debug.Log(Mathf.Pow(2, 1));
        // Prints 1.414214
        Debug.Log(Mathf.Pow(2, 0.5f));
        // Prints 1
        Debug.Log(Mathf.Pow(2, 0));
        // Prints 0.7071068
        Debug.Log(Mathf.Pow(2, -0.5f));
        // Prints 0.5
        Debug.Log(Mathf.Pow(2, -1));
        // Prints 0.00390625
        Debug.Log(Mathf.Pow(2, -8));
        // Prints 0
        Debug.Log(Mathf.Pow(2, -Mathf.Infinity));
    }
}
```
