2018-06-16 15:39:07 +02:00

52 lines
1.6 KiB
Markdown

---
layout: default
---
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
<h1 id="function-deepequal">Function deepEqual <a href="#function-deepequal" title="Permalink">#</a></h1>
Test element wise whether two matrices are equal.
The function accepts both matrices and scalar values.
Strings are compared by their numerical value.
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
```js
math.deepEqual(x, y)
```
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
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
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
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.
<h2 id="examples">Examples <a href="#examples" title="Permalink">#</a></h2>
```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]
```
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
[equal](equal.html),
[unequal](unequal.html)