Spec-Zone.ru › RethinkDB python

ReQL command: bit_xor

Command syntax

r.bit_xor(number) → number
r.bit_xor(number[, number, ...]) → number

Description

A bitwise XOR is a binary operation that takes two bit patterns of equal length and performs the logical exclusive OR operation on each pair of corresponding bits. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1. In this we perform the comparison of two bits, being 1 if the two bits are different, and 0 if they are the same.

Example:

r.expr(6).bit_xor(4).run(conn)

# Result:
2

Related commands

  • bit_and
  • bit_not
  • bit_or
  • bit_sal
  • bit_sar

© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/python/bit_xor/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API