Mimic shift method with splice to workaround safari bug
This commit is contained in:
parent
b2ed4a015a
commit
fd60264aca
10
bignumber.js
10
bignumber.js
|
@ -635,7 +635,7 @@
|
|||
} else {
|
||||
|
||||
// Remove leading elements which are zero and adjust exponent accordingly.
|
||||
for ( e = -1 ; c[0] === 0; c.shift(), e -= LOG_BASE);
|
||||
for ( e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);
|
||||
|
||||
// Count the digits of the first element of c to determine leading zeros, and...
|
||||
for ( i = 1, v = c[0]; v >= 10; v /= 10, i++);
|
||||
|
@ -800,7 +800,7 @@
|
|||
}
|
||||
|
||||
// Remove leading zeros.
|
||||
for ( ; !a[0] && a.length > 1; a.shift() );
|
||||
for ( ; !a[0] && a.length > 1; a.splice(0, 1) );
|
||||
}
|
||||
|
||||
// x: dividend, y: divisor.
|
||||
|
@ -981,7 +981,7 @@
|
|||
more = rem[0] != null;
|
||||
|
||||
// Leading zero?
|
||||
if ( !qc[0] ) qc.shift();
|
||||
if ( !qc[0] ) qc.splice(0, 1);
|
||||
}
|
||||
|
||||
if ( base == BASE ) {
|
||||
|
@ -1691,7 +1691,7 @@
|
|||
}
|
||||
|
||||
// Remove leading zeros and adjust exponent accordingly.
|
||||
for ( ; xc[0] == 0; xc.shift(), --ye );
|
||||
for ( ; xc[0] == 0; xc.splice(0, 1), --ye );
|
||||
|
||||
// Zero?
|
||||
if ( !xc[0] ) {
|
||||
|
@ -2148,7 +2148,7 @@
|
|||
if (c) {
|
||||
++e;
|
||||
} else {
|
||||
zc.shift();
|
||||
zc.splice(0, 1);
|
||||
}
|
||||
|
||||
return normalise( y, zc, e );
|
||||
|
|
Loading…
Reference in New Issue