ee.Number

Constructs a new Number.

UsageReturns
ee.Number(number)Number
ArgumentTypeDetails
numberNumber|ObjectA number or a computed object.

Examples

Code Editor (JavaScript)

print(ee.Number(0));  // 0
print(ee.Number(1));  // 1
print(ee.Number(0.0));  // 0
print(ee.Number(1.0));  // 1
print(ee.Number(-1.0));  // -1
print(ee.Number(Math.PI));  // 3.141592653589793
print(ee.Number(1.2e-35));  // 1.2e-35
print(ee.Number(3.4e10));  // 34000000000

Python setup

See the Python Environment page for information on the Python API and using geemap for interactive development.

import ee
import geemap.core as geemap

Colab (Python)

import math

print(ee.Number(0).getInfo())  # 0
print(ee.Number(1).getInfo())  # 1
print(ee.Number(0.0).getInfo())  # 0
print(ee.Number(1.0).getInfo())  # 1
print(ee.Number(-1.0).getInfo())  # -1
print(ee.Number(math.pi).getInfo())  # 3.141592653589793
print(ee.Number(1.2e-35).getInfo())  # 1.2e-35
print(ee.Number(3.4e10).getInfo())  # 34000000000