# array-almost-equal

> whether two number arrays are almost equal

Latest version **1.0.0** (published 2015-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-almost-equal
pnpm add array-almost-equal
yarn add array-almost-equal
bun add array-almost-equal
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-01-23 |
| First published | 2015-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | vector, array, rgba, color, point, position, float, floats, numbers, array, compare, test, epsilon, fuzzy, fuzz, almost-equal, arrays |

## Links

- npm: https://www.npmjs.com/package/array-almost-equal
- Repository: https://github.com/Jam3/array-almost-equal
- Issues: https://github.com/Jam3/array-almost-equal/issues
- npm.io page: https://npm.io/package/array-almost-equal

## Dependencies (2)

- [an-array](https://npm.io/package/an-array.md) ^1.0.0
- [almost-equal](https://npm.io/package/almost-equal.md) 0.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-01-23

## README

# array-almost-equal

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Tests whether two arrays are almost equal; that is, any numbers are within a certain epsilon.

```js
var almostEqual = require('array-almost-equal')

//defaults to float epsilon
almostEqual(['foo', 1, 1], ['foo', 1, 1 + 1e-12]) // true
almostEqual(['bar', 2], ['foo', 2]) // false

//custom epsilon
almostEqual(['foo', 1, 0.0025], ['foo', 1, 0.0026], 0.01) // true
```

## Usage

[![NPM](https://nodei.co/npm/array-almost-equal.png)](https://www.npmjs.com/package/array-almost-equal)

#### `almostEqual(a, b[, epsilon[, relativeTolerance]])`

Tests whether `a` and `b` are arrays (or typed arrays), equal length, and all elements are strictly equal *or* numbers are almost equal. 

`epsilon` defaults to [FLT_EPSILON](https://github.com/mikolalysenko/almost-equal/blob/master/almost_equal.js). `relativeTolerance` defaults to `epsilon` if not specified. 

## License

MIT, see [LICENSE.md](http://github.com/Jam3/array-almost-equal/blob/master/LICENSE.md) for details.

---
_Source: https://npm.io/package/array-almost-equal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
