Function deepEqual #

Test element wise whether two matrices are equal. The function accepts both matrices and scalar values.

Strings are compared by their numerical value.

Syntax #

math.deepEqual(x, y)

Parameters #

Parameter Type Description
x number | BigNumber | Fraction | Complex | Unit | Array | Matrix First matrix to compare
y number | BigNumber | Fraction | Complex | Unit | Array | Matrix Second matrix to compare

Returns #

Type Description
number | BigNumber | Fraction | Complex | Unit | Array | Matrix Returns true when the input matrices have the same size and each of their elements is equal.

Throws #

Type | Description —- | ———–

Examples #

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

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

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

See also #

equal, unequal

History #

Version Comment
v2 Handle Fractions
v0.2 Created
Fork me on GitHub