ee.Number.rightShift

v1 を v2 ビットだけ右に符号付きシフトします。

用途戻り値
Number.rightShift(right)数値
引数タイプ詳細
これ: left数値左側の値。
right数値右側の値。

コードエディタ(JavaScript)

/**
 * Unsigned 8-bit type example.
 *
 * 20 as binary:   00010100
 * Right shift 2:  00000101
 *
 * 00000101 is binary for 5.
 */

print(ee.Number(20).rightShift(2));  // 5

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

"""Unsigned 8-bit type example.

20 as binary:   00010100
Right shift 2:  00000101

00000101 is binary for 5.
"""

print(ee.Number(20).rightShift(2).getInfo())  # 5