0.1.2 • Published 7 years ago

babel-plugin-float-equal v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

babel-plugin-float-equal

Build Status tested with jest styled with prettier All Contributors

Babel plugin for float equal

Install

$ npm install --save-dev babel-plugin-float-equal

Usage

.babelrc

{
  plugins: ["float-equal"]
}

Example

0.1 + 0.2 === 0.3

      ↓ ↓ ↓ ↓ ↓ ↓

typeof (0.1 + 0.2) === 'number' && typeof 0.3 === 'number'
  ? Math.abs(0.1 + 0.2 - 0.3) < Number.EPSILON
  : 0.1 + 0.2 === 0.3

Contributors

Thanks goes to these wonderful people (emoji key):

akameco💻 📖 ⚠️ 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco