February 2019
Intermediate to advanced
626 pages
15h 51m
English
The -bnot operator is applied before a numeric value; it does not use a value on the left-hand side. The result is a value that's composed of all bits that are not set.
The -bnot operator works with signed and unsigned 32-bit and 64-bit integers (Int32, UInt32, Int64, and UInt64). When working with 8-bit or 16-bit integers (SByte, Byte, Int16, and UInt16), the result is always a signed 32-bit integer (Int32).
In the following example, the result is -123:
-bnot 122
As the preceding result is a 32-bit integer (Int32), it is difficult to show the effect in a small table. If this value were a SByte, the operation could be expressed in a table as follows:
|
Bit value |
|
Signing |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|
Before -bnot |
Read now
Unlock full access