binary-op-arbitrary-precision

1.4.0 • Public • Published

binary-op-arbitrary-precision

Build Status Coverage Status Code Climate

Binary operation abstraction for core-arbitrary-precision

Install

npm i binary-op-arbitrary-precision

Adapters

Usage

var adapter = require('floating-adapter');
var Decimal = require('core-arbitrary-precision')(adapter);
var binaryOpFactory = require('binary-op-arbitrary-precision');
 
Decimal = binaryOpFactory(Decimal, 'plus');
Decimal = binaryOpFactory(Decimal, 'plus', '+');
 
new Decimal('2').plus(new Decimal('3')).valueOf(); // => 5
new Decimal('2')['+'](new Decimal('3')).valueOf(); // => 5

See spec.

Package Sidebar

Install

npm i binary-op-arbitrary-precision

Weekly Downloads

29

Version

1.4.0

License

MIT

Last publish

Collaborators

  • javiercejudo