ee.Number.abs

Computes the absolute value of the input.

UsageReturns
Number.abs()Number
ArgumentTypeDetails
this: inputNumber

The input value.

Examples

Code Editor (JavaScript)

print('Absolute value of -1', ee.Number(-1).abs());  // 1
print('Absolute value of 0', ee.Number(0).abs());  // 0
print('Absolute value of 2.3', ee.Number(2.3).abs());  // 2.3