ee.Number.rightShift Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The
Number.rightShift(right)method calculates the signed right shift of a number (left) by a specified number of bits (right).It takes two arguments, the left-hand value (
this: left) and the right-hand value (right), both of which are Numbers.The method returns a Number, representing the result of the signed right shift operation.
| Usage | Returns |
|---|---|
Number.rightShift(right) | Number |
| Argument | Type | Details |
|---|---|---|
this:left | Number | The left-hand value. |
right | Number | The right-hand value. |
Examples
Code Editor (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 setup
See the Python Environment page for information on the Python API and usinggeemap for interactive development.
importeeimportgeemap.coreasgeemap
Colab (Python)
"""Unsigned 8-bit type example.20 as binary: 00010100Right shift 2: 0000010100000101 is binary for 5."""display(ee.Number(20).rightShift(2))# 5
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.