ClickHouse/docs/en/query_language/functions/bit_functions.md

32 lines
695 B
Markdown
Raw Normal View History

# Bit functions
2017-04-03 19:49:50 +00:00
2017-04-26 19:16:38 +00:00
Bit functions work for any pair of types from UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64, Float32, or Float64.
2017-04-03 19:49:50 +00:00
2017-04-26 19:16:38 +00:00
The result type is an integer with bits equal to the maximum bits of its arguments. If at least one of the arguments is signed, the result is a signed number. If an argument is a floating-point number, it is cast to Int64.
2017-04-03 19:49:50 +00:00
## bitAnd(a, b)
2017-04-03 19:49:50 +00:00
## bitOr(a, b)
2017-04-03 19:49:50 +00:00
## bitXor(a, b)
2017-04-03 19:49:50 +00:00
## bitNot(a)
2017-04-03 19:49:50 +00:00
## bitShiftLeft(a, b)
## bitShiftRight(a, b)
2018-04-23 06:20:21 +00:00
## bitRotateLeft(a, b)
## bitRotateRight(a, b)
## bitTest(a, b)
## bitTestAll(a, b)
## bitTestAny(a, b)
[Original article](https://clickhouse.yandex/docs/en/query_language/functions/bit_functions/) <!--hide-->