Logical Operations
Logical operations provide mechanisms for evaluating the truth or falsity of Boolean values.
The examples for each function use the following notation:
- Square brackets (
[]
) indicate arrays. - Curly braces (
{}
) indicate groups. - Arrows (
==>
) separate inputs and outputs. Inputs are shown on the left side of the arrow. Outputs are shown on the right side of the arrow.
AND
The AND
function returns True
when all its input arguments are True
. Otherwise, it returns False
.
Usage Information
Category | Details |
---|---|
Number of Arguments | 1+ |
Mandatory Argument Names and Datatypes | arg : A Boolean or Boolean array.
|
Optional Argument Names and Datatypes | N/A |
Modifiers | ignore null (Default: True ): If set to True , null values are not evaluated. If set to False , null values evaluate as null . |
Output Datatype(s) | Boolean |
note
Only one argument at most can be an array. The rest must be scalar.
Examples
and(True) ==> True
and(False) ==> False
and(null) ==> null
and(null, ignore_null=False) ==> null
and(True,True) ==> True
and(False,False) ==> False
and(True,False) ==> False
and(True,True,False) ==> False
and(True,null) ==> True
and(True,null,ignore_null=False) ==> null
and([True,True,False]) ==> False
and([True,True,null]) ==> True
and([True,True,null], ignore_null=False) ==> null
and([null]) ==> null
and([null],ignore_null=False) ==> null
and([True,True,False],False) ==> [False,False,False]
and([True,True,null],False) ==> [False,False]
and([True,null,False],True,ignore_null=False) ==> [True,null,False]
and([True,True,False],null) ==> [True,True,False] # (i.e., returns the original array value)
and([True,True,False],null,False) ==> [False,False,False]
and([True,True,False],null,ignore_null=False) ==> null
and([null],True) ==> []
and([null],True,ignore_null=False) ==> [null]
and({False,True,True},{True,False,True}) ==> {False,False,True}
and({False,True,True},True) ==> {False,True,True}
and({[False,True,True],[True,True],[False]}) ==> {False,True,False}
NOT
The NOT
function returns the opposite Boolean value of the input.
Usage Information
Category | Details |
---|---|
Number of Arguments | 1 |
Mandatory Argument Names and Datatypes | arg : A Boolean.
|
Optional Argument Names and Datatypes | N/A |
Modifiers | N/A |
Output Datatype(s) | Boolean |
Examples
not(True) ==> False
not(False) ==> True
not({True,False,True}) ==> {False,True,False}
not([True,False,True]) ==> [False,True,False]
OR
The OR
function returns True
when at least one input argument is True
. Otherwise, it returns False
.
Usage Information
Category | Details |
---|---|
Number of Arguments | 1+ |
Mandatory Argument Names and Datatypes | arg : A Boolean or Boolean array.
|
Optional Argument Names and Datatypes | N/A |
Modifiers | ignore null (Default: True ): If set to True , null values are not evaluated. If set to False , null values evaluate as null . |
Output Datatype(s) | Boolean |
note
Only one argument at most can be an array. The rest must be scalar.
Examples
or(True) ==> True
or(False) ==> False
or(True, null) ==> null
or(null, ignore_null=False) ==> null
or(True,True) ==> True
or(False,False) ==> False
or(True,False) ==> True
or(True,True,False) ==> True
or(True,null) ==> True
or(True,null,ignore_null=False) ==> null
or([True,True,False]) ==> True
or([True,True,null]) ==> True
or([True,True,null], ignore_null=False) ==> null
or([null]) ==> null
or([null],ignore_null=False) ==> null
or([True,True,False],False) ==> [True,True,False]
or([True,True,null],False) ==> [True,True]
or([True,null,False],True,ignore_null=False) ==> [True,null,True]
or([True,True,False],null) ==> [True,True,False] # (i.e., returns the original array value)
or([True,True,False],null,False) ==> [True,True,False]
or([True,True,False],null,ignore_null=False) ==> null
or([null],True) ==> []
or([null],True,ignore_null=False) ==> [null]
or({False,False,True},{True,False,True}) ==> {True,False,True}
or({False,True,True},True) ==> {True,True,True}
or({[False,True,True],[True,True],[False]}) ==> {True,True,False}