Comparing version 4.10.1 to 4.10.2
{ | ||
"name": "bn.js", | ||
"version": "4.10.1", | ||
"version": "4.10.2", | ||
"description": "Big number implementation in pure javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/bn.js", |
@@ -503,5 +503,11 @@ /* global describe, it */ | ||
it('should return GCD', function () { | ||
assert.equal(new BN(3).gcd(new BN(2)).toString(16), '1'); | ||
assert.equal(new BN(18).gcd(new BN(12)).toString(16), '6'); | ||
assert.equal(new BN(-18).gcd(new BN(12)).toString(16), '6'); | ||
assert.equal(new BN(3).gcd(new BN(2)).toString(10), '1'); | ||
assert.equal(new BN(18).gcd(new BN(12)).toString(10), '6'); | ||
assert.equal(new BN(-18).gcd(new BN(12)).toString(10), '6'); | ||
assert.equal(new BN(-18).gcd(new BN(-12)).toString(10), '6'); | ||
assert.equal(new BN(-18).gcd(new BN(0)).toString(10), '18'); | ||
assert.equal(new BN(0).gcd(new BN(-18)).toString(10), '18'); | ||
assert.equal(new BN(2).gcd(new BN(0)).toString(10), '2'); | ||
assert.equal(new BN(0).gcd(new BN(3)).toString(10), '3'); | ||
assert.equal(new BN(0).gcd(new BN(0)).toString(10), '0'); | ||
}); | ||
@@ -512,6 +518,17 @@ }); | ||
it('should return EGCD', function () { | ||
assert.equal(new BN(3).egcd(new BN(2)).gcd.toString(16), '1'); | ||
assert.equal(new BN(18).egcd(new BN(12)).gcd.toString(16), '6'); | ||
assert.equal(new BN(-18).egcd(new BN(12)).gcd.toString(16), '6'); | ||
assert.equal(new BN(3).egcd(new BN(2)).gcd.toString(10), '1'); | ||
assert.equal(new BN(18).egcd(new BN(12)).gcd.toString(10), '6'); | ||
assert.equal(new BN(-18).egcd(new BN(12)).gcd.toString(10), '6'); | ||
assert.equal(new BN(0).egcd(new BN(12)).gcd.toString(10), '12'); | ||
}); | ||
it('should not allow 0 input', function () { | ||
assert.throws(function () { | ||
BN(1).egcd(0); | ||
}); | ||
}); | ||
it('should not allow negative input', function () { | ||
assert.throws(function () { | ||
BN(1).egcd(-1); | ||
}); | ||
}); | ||
}); | ||
@@ -524,2 +541,3 @@ | ||
assert.equal(BN.max(new BN(2), new BN(2)).toString(16), '2'); | ||
assert.equal(BN.max(new BN(2), new BN(-2)).toString(16), '2'); | ||
}); | ||
@@ -533,2 +551,3 @@ }); | ||
assert.equal(BN.min(new BN(2), new BN(2)).toString(16), '2'); | ||
assert.equal(BN.min(new BN(2), new BN(-2)).toString(16), '-2'); | ||
}); | ||
@@ -535,0 +554,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
163920
4605