Page Summary
-
Array.floor() computes the largest integer less than or equal to the input on an element-wise basis.
-
The usage is
Array.floor()and it returns an Array. -
The single argument is the input array itself.
| Usage | Returns |
|---|---|
Array.floor() | Array |
| Argument | Type | Details |
|---|---|---|
this: input | Array | The input array. |
Examples
Code Editor (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]
import ee import geemap.core as geemap
Colab (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]