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 Environment.

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