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

bn.js

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bn.js - npm Package Compare versions

Comparing version 4.6.5 to 4.6.6

2

package.json
{
"name": "bn.js",
"version": "4.6.5",
"version": "4.6.6",
"description": "Big number implementation in pure javascript",

@@ -5,0 +5,0 @@ "main": "lib/bn.js",

@@ -383,22 +383,30 @@ /* global describe, it */

// 178 = 10 * 17 + 8
assert.equal(new BN(178).div(new BN(10)).toNumber(), 17);
assert.equal(new BN(178).mod(new BN(10)).toNumber(), 8);
assert.equal(new BN(178).umod(new BN(10)).toNumber(), 8);
// -178 = 10 * (-17) + (-8)
assert.equal(new BN('-178').div(new BN('10')).toString(10), '-17');
assert.equal(new BN('-178').mod(new BN('10')).toString(10), '-8');
assert.equal(new BN(-178).div(new BN(10)).toNumber(), -17);
assert.equal(new BN(-178).mod(new BN(10)).toNumber(), -8);
assert.equal(new BN(-178).umod(new BN(10)).toNumber(), 2);
// 178 = -10 * (-17) + 8
assert.equal(new BN(178).div(new BN(-10)).toNumber(), -17);
assert.equal(new BN(178).mod(new BN(-10)).toNumber(), 8);
assert.equal(new BN(178).umod(new BN(-10)).toNumber(), 8);
// -178 = -10 * (17) + (-8)
assert.equal(new BN('-178').div(new BN('-10')).toString(10), '17');
assert.equal(new BN('-178').mod(new BN('-10')).toString(10), '-8');
assert.equal(new BN(-178).div(new BN(-10)).toNumber(), 17);
assert.equal(new BN(-178).mod(new BN(-10)).toNumber(), -8);
assert.equal(new BN(-178).umod(new BN(-10)).toNumber(), 2);
// 178 = -10 * (-17) + 8
assert.equal(new BN('178').div(new BN('-10')).toString(10), '-17');
assert.equal(new BN('178').mod(new BN('-10')).toString(10), '8');
// -4 = 1 * (-3) + -1
assert.equal(new BN('-4').div(new BN('-3')).toString(10), '1');
assert.equal(new BN('-4').mod(new BN('-3')).toString(10), '-1');
assert.equal(new BN(-4).div(new BN(-3)).toNumber(), 1);
assert.equal(new BN(-4).mod(new BN(-3)).toNumber(), -1);
// -4 = -1 * (3) + -1
assert.equal(new BN('-4').mod(new BN('3')).toString(10), '-1');
assert.equal(new BN(-4).mod(new BN(3)).toNumber(), -1);
// -4 = 1 * (-3) + (-1 + 3)
assert.equal(new BN('-4').umod(new BN('-3')).toString(10), '2');
assert.equal(new BN(-4).umod(new BN(-3)).toNumber(), 2);

@@ -507,2 +515,8 @@ var p = new BN(

});
describe('BN.ineg', function () {
it('shouldn\'t change sign for zero', function () {
assert.equal(new BN(0).ineg().toString(10), '0');
});
});
});

Sorry, the diff of this file is too big to display

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