> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# BITWISE_NOT

> Inverts every bit of a signed integer.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

Returns NULL when an argument is NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
bitwise_not(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | TINYINT, SMALLINT, INT or BIGINT | Yes | The integer to complement. |

## Returns

* Type: Same signed integer type as value
* Possible values: The bitwise complement of value in its input width.
* NULL behavior: Returns NULL when an argument is NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Examples

### Complement and NULL input

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT bitwise_not(0) AS complement, bitwise_not(CAST(NULL AS INT)) AS null_value;
```

| complement | null\_value |
| - | - |
| -1 | NULL |

### Invert a zero value

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT bitwise_not(CAST(0 AS BIGINT)) AS inverted;
```

| inverted |
| - |
| -1 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.