# ee.Array.floor

On an element-wise basis, computes the largest integer less than or equal to the input.

<br />

| Usage | Returns |
|---|---|
| `Array.floor()` | Array |

| Argument | Type | Details |
|---|---|---|
| this: `input` | Array | The input array. |

## Examples

### Code Editor (JavaScript)

```javascript
// Positive numbers.
print('Floor for 2.1', ee.Array([2.1]).floor());  // 2
print('Floor for 2.5', ee.Array([2.5]).floor());  // 2
print('Floor for 2.9', ee.Array([2.9]).floor());  // 2

// Negative numbers.
print('Floor for -2.1', ee.Array([-2.1]).floor());  // -3
print('Floor for -2.5', ee.Array([-2.5]).floor());  // -3
print('Floor for -2.9', ee.Array([-2.9]).floor());  // -3

// Example with more than one number in the input array.
print('Floor for [2.1, -2.1]', ee.Array([2.1, -2.1]).floor());  // [2, -3]
```
Python setup

See the [Python Environment](https://developers.google.com/earth-engine/guides/python_install) page for information on the Python API and using
`geemap` for interactive development.

```python
import ee
import geemap.core as geemap
```

### Colab (Python)

```python
# Positive numbers.
display('Floor for 2.1:', ee.Array([2.1]).floor())  # 2
display('Floor for 2.5:', ee.Array([2.5]).floor())  # 2
display('Floor for 2.9:', ee.Array([2.9]).floor())  # 2

# Negative numbers.
display('Floor for -2.1:', ee.Array([-2.1]).floor())  # -3
display('Floor for -2.5:', ee.Array([-2.5]).floor())  # -3
display('Floor for -2.9:', ee.Array([-2.9]).floor())  # -3

# Example with more than one number in the input array.
display('Floor for [2.1, -2.1]:', ee.Array([2.1, -2.1]).floor())  # [2, -3]
```