Difference between revisions of "Or"

From APL Wiki
Jump to navigation Jump to search
(Move GCD into a dedicated page)
 
Line 34: Line 34:
  
 
* [http://help.dyalog.com/17.1/#Language/Primitive%20Functions/Or%20Greatest%20Common%20Divisor.htm Dyalog]
 
* [http://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]
 
* 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]
 
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]]
 
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]]

Latest revision as of 14:56, 1 June 2020

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

External links

Documentation

APL built-ins [edit]
Primitive functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentitySelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndex
Selector Index generatorGradeIndex OfInterval IndexIndicesDeal
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialise
Primitive operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-beamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Atop, Over) ∙ Inner ProductPowerAtUnderRankDepthVariantStencil
Quad names
Arrays Index originMigration level
Functions Case convert
Operators SearchReplace