AI-generated Key Takeaways
-
The bitwiseXor method calculates the bitwise XOR of two number values.
-
This method is called on a Number object (
left) and takes another number (right) as an argument. -
It returns a Number which is the result of the bitwise XOR operation.
-
Examples are provided in both JavaScript and Python, illustrating how to use the method with 8-bit binary representation and showing the expected output.
| Usage | Returns |
|---|---|
Number.bitwiseXor(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. * * 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));
import ee import geemap.core as geemap
Colab (Python)
"""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())