ee.Number.leftShift

คำนวณการเลื่อนบิตไปทางซ้ายของ v1 ด้วย v2 บิต

การใช้งานการคืนสินค้า
Number.leftShift(right)ตัวเลข
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ leftตัวเลขค่าด้านซ้าย
rightตัวเลขค่าทางด้านขวา

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

/**
 * Unsigned 8-bit type example.
 *
 * 20 as binary:  00010100
 * Left shift 2:  01010000
 *
 * 01010000 is binary for 80.
 */

print(ee.Number(20).leftShift(2));  // 80

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

"""Unsigned 8-bit type example.

20 as binary:  00010100
Left shift 2:  01010000

01010000 is binary for 80.
"""

print(ee.Number(20).leftShift(2).getInfo())  # 80