|
|
@ -91,29 +91,4 @@ bnjs.prototype.toNumber = function() { |
|
|
|
return parseInt(this['toString'](10), 10); |
|
|
|
}; |
|
|
|
|
|
|
|
bnjs.prototype.pow = function ( e ) { |
|
|
|
|
|
|
|
/* |
|
|
|
// e to integer, avoiding NaN or Infinity becoming 0.
|
|
|
|
var i = e * 0 == 0 ? e | 0 : e, |
|
|
|
x = new bnjs(this.toString(), 16), |
|
|
|
y = new bnjs(1); |
|
|
|
|
|
|
|
for (i = i < 0 ? -i : i; ;) { |
|
|
|
|
|
|
|
if (i & 1) { |
|
|
|
y = y.mul(x); |
|
|
|
} |
|
|
|
i >>= 1; |
|
|
|
|
|
|
|
if (!i) { |
|
|
|
break; |
|
|
|
} |
|
|
|
x = x.mul(x); |
|
|
|
} |
|
|
|
|
|
|
|
return e < 0 ? (new bnjs(1)).mul(y) : y; |
|
|
|
*/ |
|
|
|
}; |
|
|
|
|
|
|
|
module.exports = bnjs; |
|
|
|