# Sign(float)

> Returns the mathematical sign of f.

## Definition

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

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

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Real number whose sign will be retrieved.

### Returns

| Type                                                          | Description               |
| ------------------------------------------------------------- | ------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | Mathematical sign of `f`. |

### Remarks

Returns either a value of -1 when `f` is negative, or a value of 1 when `f` is 0 or greater. This is different from standard 'Sign' implementations which return 0 whenever `f` equals 0.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // Prints -1
        Debug.Log(Mathf.Sign(-10));
        // Prints 1
        Debug.Log(Mathf.Sign(0));
        // Prints 1
        Debug.Log(Mathf.Sign(10));
    }
}
```
