Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bigjs-adapter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bigjs-adapter - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

7

package.json
{
"name": "bigjs-adapter",
"version": "1.0.1",
"version": "2.0.0",
"description": "big.js adapter for linear-arbitrary-precision",

@@ -28,3 +28,3 @@ "main": "src/bigjs-adapter.js",

"gulp-mocha": "^2.0.0",
"linear-arbitrary-precision": "^2.0.0",
"linear-arbitrary-precision": "^3.0.0",
"rimraf": "^2.3.2",

@@ -34,4 +34,5 @@ "should": "^5.0.0"

"dependencies": {
"big.js": "^3.0.2"
"big.js": "^3.0.2",
"lodash.identity": "^3.0.0"
}
}

@@ -5,2 +5,3 @@ /*jshint node:true */

var identity = require('lodash.identity');
var bigjs = require('big.js');

@@ -18,3 +19,3 @@

valueOf: toString,
toJSON: toString
parseInput: identity
};

@@ -21,0 +22,0 @@

@@ -19,3 +19,3 @@ /*jshint node:true, mocha:true */

new Decimal(1).div(new Decimal(3)).toString().should.be.exactly('0.33333333333333333333');
new Decimal('1').div(new Decimal('3')).toString().should.be.exactly('0.33333333333333333333');
});

@@ -26,3 +26,3 @@

Decimal.getPrecision().should.be.exactly(42);
new Decimal(1).div(new Decimal(3)).toString().should.be.exactly('0.333333333333333333333333333333333333333333');
new Decimal('1').div(new Decimal('3')).toString().should.be.exactly('0.333333333333333333333333333333333333333333');

@@ -35,15 +35,15 @@ Decimal.setPrecision(initialPrecision);

it('should have a plus method', function() {
new Decimal(0.1).plus(new Decimal(0.2)).toString().should.be.exactly('0.3');
new Decimal('0.1').plus(new Decimal('0.2')).toString().should.be.exactly('0.3');
});
it('should have a minus method', function() {
new Decimal(0.3).minus(new Decimal(0.1)).toString().should.be.exactly('0.2');
new Decimal('0.3').minus(new Decimal('0.1')).toString().should.be.exactly('0.2');
});
it('should have a times method', function() {
new Decimal(0.6).times(new Decimal(3)).toString().should.be.exactly('1.8');
new Decimal('0.6').times(new Decimal('3')).toString().should.be.exactly('1.8');
});
it('should have a div method', function() {
new Decimal(0.3).div(new Decimal(0.2)).toString().should.be.exactly('1.5');
new Decimal('0.3').div(new Decimal('0.2')).toString().should.be.exactly('1.5');
});

@@ -54,3 +54,3 @@ });

it('should be able to return a string representation', function() {
var decimalThird = new Decimal(1).div(new Decimal(3));
var decimalThird = new Decimal('1').div(new Decimal('3'));

@@ -63,3 +63,3 @@ decimalThird.toString().should.be.exactly('0.33333333333333333333')

it('should play nicely with Number()', function() {
var decimalThird = new Decimal(1).div(new Decimal(3));
var decimalThird = new Decimal('1').div(new Decimal('3'));

@@ -74,3 +74,3 @@ Number(decimalThird).should.be.exactly(1/3);

var decimalThird = new Decimal40(1).div(new Decimal(3));
var decimalThird = new Decimal40('1').div(new Decimal('3'));
var stringified = JSON.stringify([decimalThird]);

@@ -77,0 +77,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc