NOTBITS()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a bitwise negated value.
USAGE
NOTBITS(value)
Argument Name | Description |
---|---|
| The value to bitwise negate |
DETAILS
NOTBITS()
is a bitwise function that returns the negated value where each input bit is changed to its opposite digit.
A NULL
is returned if the argument is NULL
.
The function call NOTBITS(x)
behaves in exactly the same manner as the expression ~x
.
EXAMPLES
SELECT HEX(NOTBITS(7)), HEX(NOTBITS(32767)), HEX(NOTBITS(0));
+------------------+---------------------+------------------+
| HEX(NOTBITS(7)) | HEX(NOTBITS(32767)) | HEX(NOTBITS(0)) |
+------------------+---------------------+------------------+
| FFFFFFFFFFFFFFF8 | FFFFFFFFFFFF8000 | FFFFFFFFFFFFFFFF |
+------------------+---------------------+------------------+