function multiply() {
  var set;
  if (multiply.arguments.length == 2)
   {
    set = multiply.arguments[1];
   }
  else if (multiply.arguments.length == 1)
   {
    set = this.plainMC;
   }
  else
   {
    throw "multiply(): " + multiply.arguments.length + " arguments given; expected 1 or 2";
   }
  var rhs = multiply.arguments[0];
  //--com.ibm.icu.math.BigDecimal lhs;
  var lhs;
  //--int padding;
  var padding;
  //--int reqdig;
  var reqdig;
  //--byte multer[]=null;
  var multer=null;
  //--byte multand[]=null;
  var multand=null;
  //--int multandlen;
  var multandlen;
  //--int acclen=0;
  var acclen=0;
  //--com.ibm.icu.math.BigDecimal res;
  var res;
  //--byte acc[];
  var acc;
  //--int n=0;
  var n=0;
  //--byte mult=0;
  var mult=0;
  if (set.lostDigits)
   this.checkdigits(rhs,set.digits);
  lhs=this; // name for clarity and proxy

  /* Prepare numbers (truncate, unless unlimited precision) */
  padding=0; // trailing 0's to add
  reqdig=set.digits; // local copy
  if (reqdig>0)
   {
    if (lhs.mant.length>reqdig)
     lhs=this.clone(lhs).round(set);
    if (rhs.mant.length>reqdig)
     rhs=this.clone(rhs).round(set);
   // [we could reuse the new LHS for result in this case]
   }
  else
   {/* unlimited */
    // fixed point arithmetic will want every trailing 0; we add these
    // after the calculation rather than before, for speed.
    if (lhs.exp>0)
     padding=padding+lhs.exp;
    if (rhs.exp>0)
     padding=padding+rhs.exp;
   }

  // For best speed, as in DMSRCN, we use the shorter number as the
  // multiplier and the longer as the multiplicand.
  // 1999.12.22: We used to special case when the result would fit in
  //             a long, but with Java 1.3 this gave no advantage.
  if (lhs.mant.length<rhs.mant.length)
   {
    multer=lhs.mant;
    multand=rhs.mant;
   }
  else
   {
    multer=rhs.mant;
    multand=lhs.mant;
   }

  /* Calculate how long result byte array will be */
  multandlen=(multer.length+multand.length)-1; // effective length
  // optimize for 75% of the cases where a carry is expected...
  if ((multer[0]*multand[0])>9)
   acclen=multandlen+1;
  else
   acclen=multandlen;

  /* Now the main long multiplication loop */
  res=new BigDecimal(); // where we'll build result
  acc=this.createArrayWithZeros(acclen); // accumulator, all zeros
  // 1998.07.01: calculate from left to right so that accumulator goes
  // to likely final length on first addition; this avoids a one-digit
  // extension (and object allocation) each time around the loop.
  // Initial number therefore has virtual zeros added to right.
  {var $7=multer.length;n=0;n:for(;$7>0;$7--,n++){
   mult=multer[n];
   if (mult!=0)
    { // [optimization]
     // accumulate [accumulator is reusable array]
     acc=this.byteaddsub(acc,acc.length,multand,multandlen,mult,true);
    }
   // divide multiplicand by 10 for next digit to right
   multandlen--; // 'virtual length'
   }
  }/*n*/

  res.ind=lhs.ind*rhs.ind; // final sign
  res.exp=(lhs.exp+rhs.exp)-padding; // final exponent
  // [overflow is checked by finish]

  /* add trailing zeros to the result, if necessary */
  if (padding==0)
   res.mant=acc;
  else
   res.mant=this.extend(acc,acc.length+padding); // add trailing 0s
  return res.finish(set,false);
  }
Returns a <code>BigDecimal</code> whose value is <code>this*rhs</code>.
<p>
Implements the multiplication (<b><code>*</code></b>) operator
(as defined in the decimal documentation, see {@link BigDecimal
class header}),
and returns the result as a <code>BigDecimal</code> object.

@param  rhs The <code>BigDecimal</code> for the right hand side of
            the multiplication.
@param  set The <code>MathContext</code> arithmetic settings.
@return     A <code>BigDecimal</code> whose value is
            <code>this*rhs</code>.
@stable ICU 2.0