return this;
}
// copy each components
int sign = this.sign;
NativeIntArray large = component.copy();
NativeIntArray small = subtrahend.component.copy();
// equalize each exponent
int largeExponent = exponential;
int smallExponent = subtrahend.exponential;
int maxExponent = largeExponent;
int diff = largeExponent - smallExponent;
boolean shouldSwap = false;
if (diff != 0) {
NativeIntArray min = null;
if (0 < diff) {
// "large" is larger than "small", so we should expand "small".
min = small;
} else {
// "large" is smaller than "small", so we should expand "large".
small = large;
maxExponent = smallExponent;
shouldSwap = true;
// absolutize exponent diff size
diff = -diff;
}
// prepend zero to equalize exponent
for (int i = diff; 0 < i; --i) {
min.unshift(0);
}
} else {
// each exponents are equal, so we check its digit values
int size = Math.min(large.length(), small.length());
for (int i = 0; i < size; i++) {
int largeValue = large.get(i);
int smallValue = small.get(i);
if (largeValue != smallValue) {
shouldSwap = largeValue < smallValue;
break;
}
}
}
// "large" compoent must be larger than "small" component
if (shouldSwap) {
NativeIntArray swap = large;
large = small;
small = swap;
sign = -sign;
}