# FloorToInt(float)

> Returns the greatest integer number (cast as int) smaller than or equal to f.

## Definition

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

```csharp
public static int FloorToInt(float f)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Real number to round down.

### Returns

| Type                                                       | Description                               |
| ---------------------------------------------------------- | ----------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Greatest integer number smaller than `f`. |

### Remarks

When used with negative numbers, consider that values closer to 0 are considered greater than values closer to -Infinity.

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

### Examples

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

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        // Prints 10
        Debug.Log(Mathf.FloorToInt(10.0f));
        // Prints 10
        Debug.Log(Mathf.FloorToInt(10.2f));
        // Prints 10
        Debug.Log(Mathf.FloorToInt(10.7f));

        // Prints -10
        Debug.Log(Mathf.FloorToInt(-10.0f));
        // Prints -11
        Debug.Log(Mathf.FloorToInt(-10.2f));
        // Prints -11
        Debug.Log(Mathf.FloorToInt(-10.7f));
    }
}
```
