UNPKG

1.16 kBMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function deepEqual
4
5Test element wise whether two matrices are equal.
6The function accepts both matrices and scalar values.
7
8Strings are compared by their numerical value.
9
10
11## Syntax
12
13```js
14math.deepEqual(x, y)
15```
16
17### Parameters
18
19Parameter | Type | Description
20--------- | ---- | -----------
21`x` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | First matrix to compare
22`y` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Second matrix to compare
23
24### Returns
25
26Type | Description
27---- | -----------
28number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; 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
34math.deepEqual(2, 4) // returns false
35
36a = [2, 5, 1]
37b = [2, 7, 1]
38
39math.deepEqual(a, b) // returns false
40math.equal(a, b) // returns [true, false, true]
41```
42
43
44## See also
45
46[equal](equal.md),
47[unequal](unequal.md)