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