BitNot[n]
gives the bitwise NOT of the integer n.
BitNot
BitNot[n]
gives the bitwise NOT of the integer n.
Details
- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- BitNot[n] turns ones into zeros and vice versa in the binary bit representation of n.
- Integers are assumed to be represented in two's complement form, with an unlimited number of digits, so that BitNot[n] is simply equivalent to
. » - BitNot automatically threads over lists. »
Examples
open all close allBasic Examples (2)
corresponds to having all bits on:
BitNot[0]Because integers are assumed to be represented in two's complement form, BitNot[n] is equivalent to
:
BitNot[7]Scope (1)
Applications (1)
Properties & Relations (1)
BitNot automatically threads over lists:
BitNot[Range[10]]Tech Notes
Related Guides
History
Introduced in 1999 (4.0)
Text
Wolfram Research (1999), BitNot, Wolfram Language function, https://reference.wolfram.com/language/ref/BitNot.html.
CMS
Wolfram Language. 1999. "BitNot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BitNot.html.
APA
Wolfram Language. (1999). BitNot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BitNot.html
BibTeX
@misc{reference.wolfram_2026_bitnot, author="Wolfram Research", title="{BitNot}", year="1999", howpublished="\url{https://reference.wolfram.com/language/ref/BitNot.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_bitnot, organization={Wolfram Research}, title={BitNot}, year={1999}, url={https://reference.wolfram.com/language/ref/BitNot.html}, note=[Accessed: 13-June-2026]}