# bitwise not: ~, not

bitwise 1 complement, also known as bit negation or bit-denial operation. operates on the basis of logical negation, if input is 0 then output is 1, and if input is 1 the result is 0. for example you can use it for bit deletion, or bit set to simplify the creation of masks. for example, at one variable we want to set to 1 all bits except the first 3 bits, in which case we will use a bitwise OR, given what we need one mask in case of 16-bit variable is a number 65528, using a bitwise negation we can use a simpler form number 7. reasoning is as follows, with the exception of the first three bits we want to set bits to 1, we need a mask where the first three bits are 0 and the other 1, the opposite is the first of three bits are 1 other 0, this number is simple to calculate, and then apply a bitwise negation and we have done.## ~

### Description

`~ par1`

### Input

- par1 - any integer

### Output

- Result - integers

### Examples

## Example

bitwise not the possible of use:```
x = ~(32 >>2); // x = -9
y = ~x; // y = 8
z = ~(x & 5) & y; // z = 8
```

## Example

even one example in what situations we can use the operation bitwise not:```
~i
~0xabcd
~(i & 4)
```

## Example

Other pieces of example codes:`~ 2`

## not

### Description

`not par1`

### Input

- par1 - any integer

### Output

- Result - integers

compatible programing languages:

Basic | Visual Basic .NET | FreeBASIC | Free Pascal | Object Pascal | Pascal

Basic | Visual Basic .NET | FreeBASIC | Free Pascal | Object Pascal | Pascal

### Examples

## Basic

even one example in what situations we can use the operation bitwise not:```
not i
not&Habcd
not(i and 4)
```

## Basic

Other pieces of example codes:not a

not 2

you can find it in the following collections: bitwise operators

bitwise not in another programming language: