# Bit Functions and Operators

- [BIT\_COUNT](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/bit_count.md): Count the set bits. This function returns the number of bits that are set to 1 in the binary representation of a number.
- [~](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/bitwise-not.md): Invert all bits. This unary operator flips every bit in the operand, changing 1s to 0s and 0s to 1s.
- [|](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/bitwise-or.md): Perform bitwise OR. This operator compares bits and returns 1 if at least one of the corresponding bits is 1.
- [^](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/bitwise-xor.md): Perform bitwise exclusive OR. This operator returns 1 only if the corresponding bits of the operands are different.
- [&](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/bitwise_and.md): Perform bitwise AND. This operator compares bits of two operands and returns 1 only if both corresponding bits are 1.
- [Parentheses](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/parentheses.md): Control operator precedence. Parentheses are used to group expressions and enforce the order of evaluation in complex operations.
- [<<](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/shift-left.md): Shift bits to the left. This operator shifts the binary representation of a number to the left by a specified number of positions, filling with zeros.
- [>>](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/shift-right.md): Shift bits to the right. This operator shifts the binary representation of a number to the right by a specified number of positions.
- [TRUE FALSE](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators/true-false.md): Boolean literal for 1 = TRUE or 0 = FALSE, respectively.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/bit-functions-and-operators.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
