<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/ops/math_ops.py#L5905-L5928) |

Returns element-wise largest integer not greater than x.

#### View aliases


**Main aliases**

[`tf.floor`](https://www.tensorflow.org/api_docs/python/tf/math/floor)
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.floor`](https://www.tensorflow.org/api_docs/python/tf/math/floor)

<br />

    tf.math.floor(
        x, name=None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Scalable model compression](https://www.tensorflow.org/tutorials/optimization/compression) |

Both input range is `(-inf, inf)` and the
output range consists of all integer values.

#### For example:

    x = tf.constant([1.3324, -1.5, 5.555, -2.532, 0.99, float("inf")])
    tf.floor(x).numpy()
    array([ 1., -2.,  5., -3.,  0., inf], dtype=float32)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A `Tensor`. Must be one of the following types: `bfloat16`, `half`, `float32`, `float64`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor`. Has the same type as x. ||

<br />