Function deepEqual #

以元素方式测试两个矩阵是否相等。该函数同时接受矩阵和标量值。

字符串按其数值大小进行比较。

Syntax #

math.deepEqual(x, y)

Parameters #

Parameter Type Description
x number | BigNumber | Fraction | Complex | Unit | Array | Matrix 要比较的第一个矩阵
y number | BigNumber | Fraction | Complex | Unit | Array | Matrix 要比较的第二个矩阵

Returns #

Type Description
number | BigNumber | Fraction | Complex | Unit | Array | Matrix 当输入矩阵的大小相同且每个元素都相等时返回 true。

Throws #

Type | Description —- | ———–

Examples #

math.deepEqual(2, 4)   // returns false

a = [2, 5, 1]
b = [2, 7, 1]

math.deepEqual(a, b)   // returns false
math.equal(a, b)       // returns [true, false, true]

另请参阅 #

equal, unequal

Fork me on GitHub