Difference between revisions of "And"

From APL Wiki
Jump to navigation Jump to search
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com")
 
Line 40: Line 40:
 
=== Documentation ===
 
=== Documentation ===
  
* [http://help.dyalog.com/17.1/#Language/Primitive%20Functions/And%20Lowest%20Common%20Multiple.htm Dyalog]
+
* [https://help.dyalog.com/17.1/#Language/Primitive%20Functions/And%20Lowest%20Common%20Multiple.htm Dyalog]
 
* [http://microapl.com/apl_help/ch_020_020_430.htm APLX]
 
* [http://microapl.com/apl_help/ch_020_020_430.htm APLX]
 
* J [https://www.jsoftware.com/help/dictionary/d111.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/stardot#dyadic NuVoc]
 
* J [https://www.jsoftware.com/help/dictionary/d111.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/stardot#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:30, 14 July 2020

And () is a dyadic scalar boolean function which tests if both arguments are true: it returns 1 if both are 1 and 0 if one or both are 0. It represents the logical conjunction in Boolean logic. In many APLs, And is a special case of the LCM function.

0 1
0 0 0
1 0 1

Examples

The following shows all possible combinations of inputs as a Boolean function.

      0 0 1 1  0 1 0 1
0 0 0 1

When combined with Reduce, And can be used to test if every value in a Boolean vector is true.

      / 1 1 1 1 1
1
      / 1 0 0 1 1
0

See also

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 DivideFormatExecuteMaterialiseRange
Primitive operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-beamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Atop, Over) ∙ Inner ProductPowerAtUnderRankDepthVariantStencilCut (J)
Quad names
Arrays Index originMigration levelAtomic vector
Functions Case convertUnicode convert
Operators SearchReplace