binary-op-arbitrary-precision

Binary operation abstraction for core-arbitrary-precision

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
binary-op-arbitrary-precision
0201.4.08 years ago9 years agoMinified + gzip package size for binary-op-arbitrary-precision in KB

Readme

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.