Comparing version 4.6.5 to 4.6.6
{ | ||
"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
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
152900
4361