You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

approximately-equal

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

approximately-equal - npm Package Compare versions

Comparing version

to
0.1.6

.babelrc

2

index.es5.js

@@ -17,1 +17,3 @@ 'use strict';

};
module.exports = exports['default'];

9

package.json
{
"name": "approximately-equal",
"description": "Check if two numbers are approximately equal",
"version": "0.1.5",
"version": "0.1.6",
"keywords": [

@@ -15,4 +15,5 @@ "number",

"devDependencies": {
"ava": "^0.7.0",
"babel-cli": "^6.3.15",
"ava": "^0.10.0",
"babel-cli": "^6.4.0",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.3.13"

@@ -24,3 +25,3 @@ },

"test": "ava",
"prepublish": "babel --presets es2015 index.js --out-file index.es5.js",
"prepublish": "babel index.js --out-file index.es5.js",
"postpublish": "rm -rf *.es5.js && git push --follow-tags"

@@ -27,0 +28,0 @@ },

@@ -15,2 +15,3 @@ # approximately-equal [![Build Status][travis-image]][travis-url]

import approximatelyEqual from 'approximately-equal';
approximatelyEqual(100.5, 101, 0.1); // false

@@ -22,6 +23,23 @@ approximatelyEqual(100.5, 100.6, 0.1); // true

### approximatelyEqual(a, b, error)
### approximatelyEqual(actual, expected[, error])
Check if `a` equal to `b` with approximation `error`
#### actual
Type: `number`
Actual value.
#### expected
Type: `number`
Expected value.
#### error
Type: `number`
Default: `0`
Approximation error.
## License

@@ -28,0 +46,0 @@

import test from 'ava';
import approximatelyEqual from './index.es5';
test('should be approximately equal', t => {
test('approximately equal', t => {
t.true(approximatelyEqual(100.5, 100.4, 0.1));

@@ -10,5 +10,5 @@ t.true(approximatelyEqual(100.5, 100.5, 0.1));

test('should be not equal', t => {
test('not equal', t => {
t.false(approximatelyEqual(100.5, 100.7, 0.1));
t.false(approximatelyEqual(100.5, 100.3, 0.1));
});

Sorry, the diff of this file is not supported yet