simple-squiggle/node_modules/mathjs/docs/reference/functions/deepEqual.md

54 lines
1.2 KiB
Markdown

<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
# 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
```js
math.deepEqual(x, y)
```
### Parameters
Parameter | Type | Description
--------- | ---- | -----------
`x` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | First matrix to compare
`y` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Second matrix to compare
### Returns
Type | Description
---- | -----------
number &#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.
### Throws
Type | Description
---- | -----------
## Examples
```js
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]
```
## See also
[equal](equal.md),
[unequal](unequal.md)