# Sqrt(float)

> Returns square root of f (real number whose square equals f ).

## Definition

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

```csharp
public static float Sqrt(float f)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Real number whose square root to calculate.

### Returns

| Type                                                          | Description                      |
| ------------------------------------------------------------- | -------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | Real number whose square is `f`. |

### Remarks

When used with negative values, the output will be equal to NaN.

### Examples

```csharp
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    // The formula made famous by Pythagoras, also used internally by
    // Vector3.Distance and several other standard functions.
    float HypotenuseLength(float sideALength, float sideBLength)
    {
        return Mathf.Sqrt(sideALength * sideALength + sideBLength * sideBLength);
    }
}
```
