# deepEqual() Function & Examples

Use the deepEqual() relational function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## deepEqual

#### deepEqual(x, y)

Try it yourself:

```calculio
deepEqual([1,3,4], [1,3,4])
deepEqual([1,3,4], [1,3])
```

[equal](https://calcul.io/function/equal/index.md)

[unequal](https://calcul.io/function/unequal/index.md)

[smaller](https://calcul.io/function/smaller/index.md)

[larger](https://calcul.io/function/larger/index.md)

[compare](https://calcul.io/function/compare/index.md)

---

## deepEqual(): Comparing Complete Values

**deepEqual()** tests whether two values have the same content throughout their structure. Unlike a simple identity test, it is intended for arrays, matrices, objects, and nested collections where every corresponding member matters. For example, deepEqual([1, 2], [1, 2]) is true, while deepEqual([1, 2], [2, 1]) is false because order differs.

## What “deep” means

A deep comparison descends into nested values rather than comparing only the outer container. That makes it useful for checking expected results in calculations, validating imported data, and confirming that a transformation preserved information. Use [equal()](https://calcul.io/function/equal/index.md) for ordinary equality and [compare()](https://calcul.io/function/compare/index.md) when an ordering result is more useful than a boolean.

Be deliberate about numeric precision. Values that print similarly can still differ by a tiny floating-point amount, so exact deep equality is not usually the right test for measured or iterative results. Compare an error against a tolerance with [abs()](https://calcul.io/function/abs/index.md) instead. For matrices, inspect dimensions with [size()](https://calcul.io/function/size/index.md) before diagnosing a failed comparison.

## Practical checks

deepEqual is especially helpful after [clone()](https://calcul.io/function/clone/index.md), parsing, or reshaping data: it can verify that values match while remaining separate values in a workflow. It does not mean two values are mathematically “close”; it means their represented structure and contents agree exactly.

[All functions](https://calcul.io/functions/index.md)
