ee.Number.ceil

Computes the smallest integer greater than or equal to the input.

UsageReturns
Number.ceil()Number
ArgumentTypeDetails
this: inputNumber

The input value.

Examples

Code Editor (JavaScript)

// Positive numbers.
print('Ceiling for 2.1', ee.Number(2.1).ceil());  // 3
print('Ceiling for 2.5', ee.Number(2.5).ceil());  // 3
print('Ceiling for 2.9', ee.Number(2.9).ceil());  // 3

// Negative numbers.
print('Ceiling for 2.1', ee.Number(-2.1).ceil());  // -2
print('Ceiling for 2.5', ee.Number(-2.5).ceil());  // -2
print('Ceiling for 2.9', ee.Number(-2.9).ceil());  // -2