unary-op-arbitrary-precision
v1.3.0
Published
unary operation abstraction for core-arbitrary-precision
Downloads
15
Maintainers
Readme
unary-op-arbitrary-precision
unary operation abstraction for core-arbitrary-precision
Install
npm i unary-op-arbitrary-precision
Adapters
- See adapters
Usage
var adapter = require('floating-adapter');
var Decimal = require('core-arbitrary-precision')(adapter);
var unaryOpFactory = require('unary-op-arbitrary-precision');
Decimal = unaryOpFactory(Decimal, 'sqrt');
Decimal = unaryOpFactory(Decimal, 'sqrt', '√');
new Decimal('9').sqrt().valueOf(); // => 3
new Decimal('9')['√']().valueOf(); // => 3
See spec.