WOLFRAM

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

e1||e2||

is the logical OR function. It evaluates its arguments in order, giving True immediately if any of them are True , and False if they are all False .

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

e1||e2||

is the logical OR function. It evaluates its arguments in order, giving True immediately if any of them are True , and False if they are all False .

Details

  • Or [e1,e2,] can be input in StandardForm and InputForm as e_(1)∨e_(2)∨.... The character can be entered as ||, or, or \[Or] .
  • Or has attribute HoldAll , and explicitly controls the evaluation of its arguments. In e_(1)||e_(2)||... the e_(i) are evaluated in order, stopping if any of them are found to be True .
  • Or gives symbolic results when necessary, removing initial arguments that are False .

Examples

open all close all

Basic Examples  (4)

Combine assertions with ||:

A symbolic disjunction:

A system of equations:

Enter using or:

Scope  (5)

Or works with any number of arguments:

Or is associative:

Or with explicit True or False arguments will simplify:

Or evaluates its arguments in order, stopping when an argument evaluates to True :

The order of arguments may be important:

Symbolic transformations will not preserve argument ordering:

TraditionalForm formatting:

Applications  (6)

Combine conditions in a Wolfram Language program:

If an argument of Or evaluates to True , any subsequent arguments are not evaluated:

The argument order in Or matters; if the last two arguments are reversed, I 0 is evaluated:

Combine assumptions:

Combine equations and inequalities; Or is used both in the input and the output:

Use || to combine conditions:

A cellular automaton based on Or :

Find the area of the union of sets given by algebraic conditions:

This shows the set:

Properties & Relations  (7)

Truth table for binary Or :

Ternary Or :

Zero-argument Or is False :

Or with a single argument will return the evaluated argument regardless of value:

&& has higher precedence than ||:

Use BooleanConvert to expand And with respect to Or :

De Morgan's laws relate And , Or , and Not :

Disjunction of conditions corresponds to the Max of Boole functions:

See Also

Xor   BooleanConvert   LogicalExpand   BitOr   Nor   And   Not   Disjunction   Union   BooleanCountingFunction   AnyTrue

Characters: \[Or]

Function Repository: VennDiagram

History

Introduced in 1988 (1.0) | Updated in 1996 (3.0)

Wolfram Research (1988), Or, Wolfram Language function, https://reference.wolfram.com/language/ref/Or.html (updated 1996).

Text

Wolfram Research (1988), Or, Wolfram Language function, https://reference.wolfram.com/language/ref/Or.html (updated 1996).

CMS

Wolfram Language. 1988. "Or." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Or.html.

APA

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

BibTeX

@misc{reference.wolfram_2025_or, author="Wolfram Research", title="{Or}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Or.html}", note=[Accessed: 06-January-2026]}

BibLaTeX

@online{reference.wolfram_2025_or, organization={Wolfram Research}, title={Or}, year={1996}, url={https://reference.wolfram.com/language/ref/Or.html}, note=[Accessed: 06-January-2026]}

Top [フレーム]

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