@learncard/ethereum-plugin 1.1.31 → 1.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3615,7 +3615,10 @@ var require_bn = __commonJS({
3615
3615
  this.words[i] = carry;
3616
3616
  this.length++;
3617
3617
  }
3618
- this.length = num === 0 ? 1 : this.length;
3618
+ if (num === 0) {
3619
+ this.length = 1;
3620
+ this._normSign();
3621
+ }
3619
3622
  return isNegNum ? this.ineg() : this;
3620
3623
  }, "imuln");
3621
3624
  BN3.prototype.muln = /* @__PURE__ */ __name(function muln(num) {
@@ -4008,12 +4011,14 @@ var require_bn = __commonJS({
4008
4011
  BN3.prototype.divRound = /* @__PURE__ */ __name(function divRound(num) {
4009
4012
  var dm = this.divmod(num);
4010
4013
  if (dm.mod.isZero()) return dm.div;
4011
- var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
4012
- var half = num.ushrn(1);
4013
- var r2 = num.andln(1);
4014
+ var mod = dm.mod.abs();
4015
+ var half = num.abs().iushrn(1);
4016
+ var r2 = num.words[0] & 1;
4014
4017
  var cmp = mod.cmp(half);
4015
4018
  if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
4016
- return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
4019
+ var up = new BN3(1);
4020
+ up.negative = this.negative ^ num.negative;
4021
+ return dm.div.iadd(up);
4017
4022
  }, "divRound");
4018
4023
  BN3.prototype.modrn = /* @__PURE__ */ __name(function modrn(num) {
4019
4024
  var isNegNum = num < 0;