Or: Difference between revisions
Jump to navigation
Jump to search
(→Documentation: APLX) |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
{|class=wikitable | {|class=wikitable | ||
!< | !<syntaxhighlight lang=apl inline>∨</syntaxhighlight>!!<syntaxhighlight lang=apl inline>0</syntaxhighlight>!!<syntaxhighlight lang=apl inline>1</syntaxhighlight> | ||
|- | |- | ||
!< | !<syntaxhighlight lang=apl inline>0</syntaxhighlight> | ||
|< | |<syntaxhighlight lang=apl inline>0</syntaxhighlight>||<syntaxhighlight lang=apl inline>1</syntaxhighlight> | ||
|- | |- | ||
!< | !<syntaxhighlight lang=apl inline>1</syntaxhighlight> | ||
|< | |<syntaxhighlight lang=apl inline>1</syntaxhighlight>||<syntaxhighlight lang=apl inline>1</syntaxhighlight> | ||
|} | |} | ||
Line 15: | Line 15: | ||
The following shows all possible combinations of inputs as a Boolean function. | The following shows all possible combinations of inputs as a Boolean function. | ||
< | <syntaxhighlight lang=apl> | ||
0 0 1 1 ∨ 0 1 0 1 | 0 0 1 1 ∨ 0 1 0 1 | ||
0 1 1 1 | 0 1 1 1 | ||
</ | </syntaxhighlight> | ||
When combined with [[Reduce]], Or can be used to test if some value in a Boolean vector is true. | When combined with [[Reduce]], Or can be used to test if some value in a Boolean vector is true. | ||
< | <syntaxhighlight lang=apl> | ||
∨/ 0 0 1 0 1 | ∨/ 0 0 1 0 1 | ||
1 | 1 | ||
∨/ 0 0 0 0 0 | ∨/ 0 0 0 0 0 | ||
0 | 0 | ||
</ | </syntaxhighlight> | ||
== See also == | |||
* [[Add]] | |||
* [[Maximum]] | |||
* [[Union]] | |||
* [[Nor]] | |||
* [[And]] | |||
== External links == | == External links == | ||
Line 33: | Line 40: | ||
=== Documentation === | === Documentation === | ||
* [ | * [https://help.dyalog.com/17.1/#Language/Primitive%20Functions/Or%20Greatest%20Common%20Divisor.htm Dyalog] | ||
* [http://microapl.com/apl_help/ch_020_020_420.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_420.htm APLX] | ||
* J [https://www.jsoftware.com/help/dictionary/d101.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/plusdot#dyadic NuVoc] | * J [https://www.jsoftware.com/help/dictionary/d101.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/plusdot#dyadic NuVoc] | ||
* [https://mlochbaum.github.io/BQN/doc/logic.html BQN] | |||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]] |
Latest revision as of 22:25, 10 September 2022
∨
|
Or (∨
) is a dyadic scalar boolean function which tests if at least one of the two arguments is true: it returns 1 if at least one side is 1 and 0 if both are 0. It represents the logical disjunction in Boolean logic. In many APLs, Or is a special case of the GCD function.
∨ |
0 |
1
|
---|---|---|
0
|
0 |
1
|
1
|
1 |
1
|
Examples
The following shows all possible combinations of inputs as a Boolean function.
0 0 1 1 ∨ 0 1 0 1 0 1 1 1
When combined with Reduce, Or can be used to test if some value in a Boolean vector is true.
∨/ 0 0 1 0 1 1 ∨/ 0 0 0 0 0 0
See also
External links
Documentation
- Dyalog
- APLX
- J Dictionary, NuVoc
- BQN