decimal.js
function multiplyInteger(x, k) {
      var temp,
        carry = 0,
        i = x.length;

      for (x = x.slice(); i--;) {
        temp = x[i] * k + carry;
        x[i] = temp % BASE | 0;
        carry = temp / BASE | 0;
      }

      if (carry) x.unshift(carry);

      return x;
    }
function multiplyInteger(x, k) {
      var temp,
        carry = 0,
        i = x.length;

      for (x = x.slice(); i--;) {
        temp = x[i] * k + carry;
        x[i] = temp % BASE | 0;
        carry = temp / BASE | 0;
      }

      if (carry) x.unshift(carry);

      return x;
    }
function multiplyInteger ( x , k ) { var temp , carry = 0 , i = x . length ; for ( x = x . slice ( ) ; i -- ; ) { temp = x [ i ] * k + carry ; x [ i ] = temp % BASE | 0 ; carry = temp / BASE | 0 ; } if ( carry ) x . unshift ( carry ) ; return x ; }
Assumes non-zero x and k, and hence non-zero result.
Assumes non - zero x and k and hence non - zero result .