BigInt multiply(BigInt n) {
		BigInt result = new BigInt(digits_.length + n.digits_.length);
		result.sign_ = sign_ * n.sign_;
		int i = 0, j = 0;
		for (i = 0; i < n.digits_.length; ++i) {
			if (n.digits_[i] != 0) {
				int carry = 0;
				for (j = 0; j < digits_.length || carry > 0; ++j) {
					int n_digit = result.digits_[i + j]
							+ (j < digits_.length ? n.digits_[i] * digits_[j] : 0) + carry;
					result.digits_[i + j] = (char) (n_digit % 10);
					carry = n_digit / 10;
				}
			}
		}

		// If one number is 0, the result size should be 0.
		if ((digits_.length == 1 && digits_[0] == 0)
				|| (n.digits_.length == 1 && n.digits_[0] == 0)) {
			result.sign_ = 1;
			result.digits_ = Arrays.copyOf(result.digits_, 1);
		} else {
			result.digits_ = Arrays.copyOf(result.digits_, i + j - 1);
		}
		return result;
	}