ee.Number.floor

Computes the largest integer less than or equal to the input.

UsageReturns
Number.floor()Number
ArgumentTypeDetails
this: inputNumber

The input value.

Examples

Code Editor (JavaScript)

// Positive numbers.
print('Floor for 2.1', ee.Number(2.1).floor());  // 2
print('Floor for 2.5', ee.Number(2.5).floor());  // 2
print('Floor for 2.9', ee.Number(2.9).floor());  // 2

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