ee.Number.bitwiseXor
Calculates the bitwise XOR of the input values.
Usage | Returns |
---|
Number.bitwiseXor(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
* Only one digit is 1?: 00001100
*
* 00001100 is unsigned 8-bit binary for 12.
*/
print(ee.Number(25).bitwiseXor(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
Only one digit is 1?: 00001100
00001100 is unsigned 8-bit binary for 12.
"""
print(ee.Number(25).bitwiseXor(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."],[[["`Number.bitwiseXor()` calculates the bitwise XOR of two numbers, returning the result as a Number."],["The function takes two arguments: `left` (the left-hand value) and `right` (the right-hand value), both of which are Numbers."],["Bitwise XOR compares the corresponding bits of the input numbers and outputs a 1 if only one bit is 1, otherwise it outputs a 0."],["Provided examples in JavaScript, Python, and Colab demonstrate how to use the `bitwiseXor()` function with Earth Engine Numbers."]]],[]]