Perform boolean logic operations.
and(a, b)
)a AND b
)AND
operator:
AND
operatorval1
, val2
, … (Int
, UInt
, Float
, or Nullable
): List of at least two values.0
if at least one argument evaluates to falseNULL
if no argument evaluates to false and at least one argument is NULL1
otherwiseUInt8
or Nullable(UInt8)
Example:
In this example, should_celebrate
is true only when it’s Taco Tuesday, there’s guacamole, and more than 3 tacos are available.
OR
operatorval1
, val2
, … (Int
, UInt
, Float
, or Nullable
): List of at least two values.1
if at least one argument evaluates to true0
if all arguments evaluate to falseNULL
if all arguments evaluate to false and at least one argument is NULLUInt8
or Nullable(UInt8)
.
Example:
hasProteinOption
is true if at least one protein option (carnitas, chicken, or beef) is available.
!
val
(Int
, UInt
, Float
, or Nullable
): The value.1
if val
evaluates to false0
if val
evaluates to trueNULL
if val
is NULLUInt8
or Nullable(UInt8)
.
Example:
isMild
is the logical negation of isSpicy
.
val1
, val2
, … (Int
, UInt
, Float
, or Nullable
): List of at least two values.1
if one of the values evaluates to false and the other does not0
if both values evaluate to false or both trueNULL
if at least one of the inputs is NULLUInt8
or Nullable(UInt8)
.
Example:
hasUniqueTopping
is true if exactly one of salsa, guacamole, or sour cream is present on the taco.
val
(Int
, UInt
, Float
, or Nullable
): The value to negate.1
if val
evaluates to false0
if val
evaluates to trueNULL
if val
is NULLUInt8
or Nullable(UInt8)
Example:
not(1)
returns 0 because 1 is considered truenot(0)
returns 1 because 0 is considered falsenot(NULL)
returns NULLnot(isHot('jalapeño'))
returns 0, assuming jalapeños are considered hotnot
function treats any non-zero value as true and zero as false. This applies to all numeric types, including floating-point numbers.