Bit inversion

Uses your system voice; voice and rate in settings.

Snapshot

≈ 1 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In computing and telecommunications, bit inversion refers to the changing of the state of a bit or binary number to the opposite state, for example changing a 0 bit to 1 or vice versa. It is often represented with a tilde (~). It also refers to the changing of a state representing a given bit to the opposite state.

In computing and telecommunications, bit inversion refers to the changing of the state of a bit or binary number to the opposite state, for example changing a 0 bit to 1 or vice versa. It is often represented with a tilde (~). It also refers to the changing of a state representing a given bit to the opposite state.

Usage in computing

Many popular programming languages implement bit inversion as an operation. For example, in JavaScript, bit inversion is known as a 'bitwise NOT' and is implemented as seen below: var a = 2; var b = ~ a; In this example, a is a 32-bit signed integer and in binary would be . Variable is the bit inversion of variable and equals (−3 in decimal). In Python: >>> a = 2 >>> b = ~ a >>> b -3

Text derived from https://en.wikipedia.org/w/index.php?oldid=1378025641 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

4 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.