bigjs-adapter
Advanced tools
Comparing version 2.0.2 to 2.1.0
{ | ||
"name": "bigjs-adapter", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "big.js adapter for linear-arbitrary-precision", | ||
@@ -23,2 +23,3 @@ "main": "src/bigjs-adapter.js", | ||
"devDependencies": { | ||
"arbitrary-precision": "^1.0.0", | ||
"gulp": "^3.8.11", | ||
@@ -29,3 +30,2 @@ "gulp-coverage": "^0.3.34", | ||
"gulp-mocha": "^2.0.0", | ||
"linear-arbitrary-precision": "^3.0.0", | ||
"rimraf": "^2.3.2", | ||
@@ -32,0 +32,0 @@ "should": "^5.0.0" |
@@ -16,2 +16,3 @@ /*jshint node:true */ | ||
div: div, | ||
pow: pow, | ||
toString: toString, | ||
@@ -46,4 +47,8 @@ valueOf: toString, | ||
function pow(x, y) { | ||
return x.pow(Number(y)); | ||
} | ||
function toString(x) { | ||
return x.toString(); | ||
} |
@@ -7,7 +7,8 @@ /*jshint node:true, mocha:true */ | ||
var decimalFactory = require('linear-arbitrary-precision'); | ||
var decimalFactory = require('arbitrary-precision'); | ||
var adapter = require('../src/bigjs-adapter'); | ||
var Decimal = decimalFactory(adapter); | ||
describe('linear arbitrary precision with big.js', function() { | ||
var Decimal = decimalFactory(adapter); | ||
@@ -48,2 +49,10 @@ describe('precision', function() { | ||
}); | ||
it('should have a pow method with support for ints only', function() { | ||
new Decimal('2').pow(new Decimal('3')).valueOf().should.be.exactly('8'); | ||
(function() { | ||
new Decimal('81').pow(new Decimal('0.5')).valueOf().should.be.exactly('9'); | ||
}).should.throw('!pow!'); | ||
}); | ||
}); | ||
@@ -50,0 +59,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7844
125