1 |
|
2 |
|
3 | # Function deepEqual
|
4 |
|
5 | Test element wise whether two matrices are equal.
|
6 | The function accepts both matrices and scalar values.
|
7 |
|
8 | Strings are compared by their numerical value.
|
9 |
|
10 |
|
11 | ## Syntax
|
12 |
|
13 | ```js
|
14 | math.deepEqual(x, y)
|
15 | ```
|
16 |
|
17 | ### Parameters
|
18 |
|
19 | Parameter | Type | Description
|
20 | --------- | ---- | -----------
|
21 | `x` | number | BigNumber | Fraction | Complex | Unit | Array | Matrix | First matrix to compare
|
22 | `y` | number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Second matrix to compare
|
23 |
|
24 | ### Returns
|
25 |
|
26 | Type | Description
|
27 | ---- | -----------
|
28 | number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Returns true when the input matrices have the same size and each of their elements is equal.
|
29 |
|
30 |
|
31 | ## Examples
|
32 |
|
33 | ```js
|
34 | math.deepEqual(2, 4) // returns false
|
35 |
|
36 | a = [2, 5, 1]
|
37 | b = [2, 7, 1]
|
38 |
|
39 | math.deepEqual(a, b) // returns false
|
40 | math.equal(a, b) // returns [true, false, true]
|
41 | ```
|
42 |
|
43 |
|
44 | ## See also
|
45 |
|
46 | [equal](equal.md),
|
47 | [unequal](unequal.md)
|