4.0.4 • Published 9 years ago
is-equal-enough v4.0.4
is-equal-enough
Determine whether values are within a tolerance of each other
isEqualEnough(a, b, tolerance) ⇒ boolean
Determine whether two numbers are within a provided tolerance of each other.
Kind: global function
Returns: boolean - Whether the numbers are within the tolerance or not.
| Param | Type | Default | Description |
|---|---|---|---|
| a | number | A number | |
| b | number | Another number | |
| tolerance | number | Number.EPSILON | The acceptable tolerance. |
Example
isEqualEnough(0.15 + 0.15, 0.1 + 0.2);
// → trueScripts
test – run the tests
npm run testcoverage – generate and view code coverage as HTML
npm run coveragelint – lint the codebase
npm run lintreadme – generate the README
npm run readmecompile – compile the code
npm run compileLicense
MIT @ Flip