0.1.0 • Published 8 years ago

@f/almost-equal v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

almost-equal

Build status Git tag NPM version Code style

Check if two numbers are almost equal.

Installation

$ npm install @f/almost-equal

Usage

var almostEqual = require('@f/almost-equal')

almostEqual(1, 1.5, 1) // -> true
almostEqual(1, 2.1, 1) // -> false

API

almostEqual(a, b, margin)

  • a - First value to compare.
  • b - second value to compare.
  • margin - Margin between two numbers which is tolerated and seen as "almost equal".

Returns: A boolean if the two values a and b are almost equal.

License

MIT