Function and #

Logical and。测试两个值是否都已定义且具有非零/非空值。对于矩阵,函数将逐元素进行计算。

Syntax #

math.and(x, y)

Parameters #

Parameter Type Description
x number | BigNumber | bigint | Complex | Unit | Array | Matrix 第一个要检查的值
y number | BigNumber | bigint | Complex | Unit | Array | Matrix 要检查的第二个值

Returns #

Type Description
boolean | Array | Matrix 当两个输入都已定义且具有非零/非空值时返回 true。

Throws #

Type | Description —- | ———–

Examples #

math.and(2, 4)   // returns true

a = [2, 0, 0]
b = [3, 7, 0]
c = 0

math.and(a, b)   // returns [true, false, false]
math.and(a, c)   // returns [false, false, false]

另请参阅 #

not, or, xor

Fork me on GitHub