WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

BitOr [n1,n2,]

gives the bitwise OR of the integers ni.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Generalizations & Extensions  
Applications  
Properties & Relations  
Neat Examples  
See Also
Tech Notes
Related Guides
Related Links
History
Cite this Page

BitOr [n1,n2,]

gives the bitwise OR of the integers ni.

Details

  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • BitOr [n1,n2,] yields the integer whose binary bit representation has ones at positions where the binary bit representations of any of the ni have ones.
  • For negative integers BitOr assumes a two's complement representation.
  • BitOr automatically threads over lists.

Examples

open all close all

Basic Examples  (1)

Scope  (3)

Use numbers of any size:

BitOr takes any number of arguments:

Use negative numbers:

Generalizations & Extensions  (2)

Basic symbolic simplifications are done automatically:

-1 corresponds to having all bits on:

Applications  (2)

Make a nested pattern:

Properties & Relations  (2)

Truth table for Or :

BitOr is Orderless :

Neat Examples  (1)

See Also

BitAnd   BitXor   BitNot   BitSet   Or   IntegerDigits   CellularAutomaton

Function Repository: BitBooleanFunction

History

Introduced in 1999 (4.0)

Wolfram Research (1999), BitOr, Wolfram Language function, https://reference.wolfram.com/language/ref/BitOr.html.

Text

Wolfram Research (1999), BitOr, Wolfram Language function, https://reference.wolfram.com/language/ref/BitOr.html.

CMS

Wolfram Language. 1999. "BitOr." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BitOr.html.

APA

Wolfram Language. (1999). BitOr. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BitOr.html

BibTeX

@misc{reference.wolfram_2025_bitor, author="Wolfram Research", title="{BitOr}", year="1999", howpublished="\url{https://reference.wolfram.com/language/ref/BitOr.html}", note=[Accessed: 05-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_bitor, organization={Wolfram Research}, title={BitOr}, year={1999}, url={https://reference.wolfram.com/language/ref/BitOr.html}, note=[Accessed: 05-December-2025]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /