函数 非 #
逻辑 not。翻转给定参数的布尔值。对于矩阵,该函数逐元素计算。
Syntax #
math.not(x)
Parameters #
| Parameter | Type | Description |
|---|---|---|
x |
number | BigNumber | bigint | Complex | Unit | Array | Matrix | 第一个要检查的值 |
Returns #
| Type | Description |
|---|---|
| boolean | Array | Matrix | 当输入为零值或空值时返回 true。 |
Throws #
Type | Description —- | ———–
Examples #
math.not(2) // returns false
math.not(0) // returns true
math.not(true) // returns false
a = [2, -7, 0]
math.not(a) // returns [false, false, true]