pow and abs in the bigInt wrapper

This commit is contained in:
Jordi Baylina 2019-09-05 17:11:31 +02:00
parent 83bca745d0
commit 3cbc29caf1
No known key found for this signature in database
GPG Key ID: 7480C80C1BE43112

@ -177,6 +177,14 @@ if (typeof(BigInt) != "undefined") {
return this % c;
};
wBigInt.prototype.pow = function(c) {
return this ** c;
};
wBigInt.prototype.abs = function() {
return (this > wBigInt.zero) ? this : -this;
};
wBigInt.prototype.modPow = function(e, m) {
let acc = wBigInt.one;
let exp = this;