deepEqual.md (1215B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 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 ### Throws 32 33 Type | Description 34 ---- | ----------- 35 36 37 ## Examples 38 39 ```js 40 math.deepEqual(2, 4) // returns false 41 42 a = [2, 5, 1] 43 b = [2, 7, 1] 44 45 math.deepEqual(a, b) // returns false 46 math.equal(a, b) // returns [true, false, true] 47 ``` 48 49 50 ## See also 51 52 [equal](equal.md), 53 [unequal](unequal.md)