ee.Number.bitwiseOr
Calculates the bitwise OR of the input values.
Usage | Returns |
---|
Number.bitwiseOr(right) | Number |
Argument | Type | Details |
---|
this: left | Number | The left-hand value. |
right | Number | The right-hand value. |
Examples
/**
* Unsigned 8-bit type example.
*
* 25 as binary: 00011001
* 21 as binary: 00010101
* Either digit 1?: 00011101
*
* 00011101 is unsigned 8-bit binary for 29.
*/
print(ee.Number(25).bitwiseOr(21));
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
"""Unsigned 8-bit type example.
25 as binary: 00011001
21 as binary: 00010101
Either digit 1?: 00011101
00011101 is unsigned 8-bit binary for 29.
"""
print(ee.Number(25).bitwiseOr(21).getInfo())
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["This function calculates the bitwise OR of two numbers, `left` and `right`."],["The result is a new number where each bit is set to 1 if the corresponding bit in either `left` or `right` is 1, otherwise it's set to 0."],["It's demonstrated with an unsigned 8-bit example where `25` bitwise OR `21` results in `29`."],["Examples are provided for JavaScript, Python with `geemap`, and Python in Colab."]]],["The `bitwiseOr` method computes the bitwise OR of two numbers. It takes a right-hand value (`right`) as an argument and uses the calling number as the left-hand value (`left`). The method returns a new `Number` object representing the result of the OR operation. For instance, the bitwise OR of 25 (00011001) and 21 (00010101) is 29 (00011101), where each digit is 1 if either of the corresponding input digits is 1.\n"]]