Casts the input value to a 32-bit float.
Usage | Returns | Number.float() | Number |
Argument | Type | Details | this: input | Number | The input value. |
Examples
Code Editor (JavaScript)
// Declare an ee.Number.
var number = ee.Number(100);
print('ee.Number:', number);
// Cast a number to signed 32-bit floating point.
var floatNumber = number.float();
print('ee.Number cast to float:', floatNumber);
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)
# Declare an ee.Number.
number = ee.Number(100)
print('ee.Number:', number.getInfo())
# Cast a number to signed 32-bit floating point.
float_number = number.float()
print('ee.Number cast to float:', float_number.getInfo())