Mimic unshift method with array concat to workaround safari bug

This commit is contained in:
jamsinclair 2017-05-04 00:32:15 +12:00
parent fd60264aca
commit 31661274aa
1 changed files with 5 additions and 5 deletions

View File

@ -728,7 +728,7 @@
if ( !d ) {
++e;
xc.unshift(1);
xc = [1].concat(xc);
}
}
}
@ -766,7 +766,7 @@
x[i] = temp % base;
}
if (carry) x.unshift(carry);
if (carry) x = [carry].concat(x);
return x;
}
@ -869,7 +869,7 @@
// Add zeros to make remainder as long as divisor.
for ( ; remL < yL; rem[remL++] = 0 );
yz = yc.slice();
yz.unshift(0);
yz = [0].concat(yz);
yc0 = yc[0];
if ( yc[1] >= base / 2 ) yc0++;
// Not necessary, but to prevent trial digit n > base, when using base 3.
@ -940,7 +940,7 @@
prodL = prod.length;
}
if ( prodL < remL ) prod.unshift(0);
if ( prodL < remL ) prod = [0].concat(prod);
// Subtract product from remainder.
subtract( rem, prod, remL, base );
@ -1859,7 +1859,7 @@
}
if (a) {
xc.unshift(a);
xc = [a].concat(xc);
++ye;
}