ee.Number.subtract

Subtracts the second value from the first.

UsageReturns
Number.subtract(right)Number
ArgumentTypeDetails
this: leftNumber

The left-hand value.

rightNumber

The right-hand value.

Examples

Code Editor (JavaScript)

print('5 - 10', ee.Number(5).subtract(ee.Number(10)));  // -5
print('10 - 5', ee.Number(10).subtract(ee.Number(5)));  // 5
print('5 - 10.2', ee.Number(5).subtract(ee.Number(10.2)));  // -5.199999999
print('5 - -10.2', ee.Number(5).subtract(ee.Number(-10.2)));  // 15.2