function layout() {
  //--char cmant[];
  var cmant;
  //--int i=0;
  var i=0;
  //--java.lang.StringBuffer sb=null;
  var sb=null;
  //--int euse=0;
  var euse=0;
  //--int sig=0;
  var sig=0;
  //--char csign=0;
  var csign=0;
  //--char rec[]=null;
  var rec=null;
  //--int needsign;
  var needsign;
  //--int mag;
  var mag;
  //--int len=0;
  var len=0;
  cmant=new Array(this.mant.length); // copy byte[] to a char[]
  {var $18=this.mant.length;i=0;i:for(;$18>0;$18--,i++){
   cmant[i]=this.mant[i]+'';
   }
  }/*i*/

  if (this.form!=MathContext.prototype.PLAIN)
   {/* exponential notation needed */
    //--sb=new java.lang.StringBuffer(cmant.length+15); // -x.xxxE+999999999
    sb="";
    if (this.ind==this.isneg)
     sb += '-';
    euse=(this.exp+cmant.length)-1; // exponent to use
    /* setup sig=significant digits and copy to result */
    if (this.form==MathContext.prototype.SCIENTIFIC)
     { // [default]
      sb += cmant[0]; // significant character
      if (cmant.length>1)  // have decimal part
       //--sb.append('.').append(cmant,1,cmant.length-1);
       sb += '.';
       sb += cmant.slice(1).join("");
     }
    else
     {engineering:do{
      sig=euse%3; // common
      if (sig<0)
       sig=3+sig; // negative exponent
      euse=euse-sig;
      sig++;
      if (sig>=cmant.length)
       { // zero padding may be needed
        //--sb.append(cmant,0,cmant.length);
        sb += cmant.join("");
        {var $19=sig-cmant.length;for(;$19>0;$19--){
         sb += '0';
         }
        }
       }
      else
       { // decimal point needed
        //--sb.append(cmant,0,sig).append('.').append(cmant,sig,cmant.length-sig);
        sb += cmant.slice(0,sig).join("");
        sb += '.';
        sb += cmant.slice(sig).join("");
       }
     }while(false);}/*engineering*/
    if (euse!=0)
     {
      if (euse<0)
       {
        csign='-';
        euse=-euse;
       }
      else
       csign='+';
      //--sb.append('E').append(csign).append(euse);
      sb += 'E';
      sb += csign;
      sb += euse;
     }
    //--rec=new Array(sb.length);
    //--Utility.getChars(sb, 0,sb.length(),rec,0);
    //--return rec;
    return sb.split("");
   }

  /* Here for non-exponential (plain) notation */
  if (this.exp==0)
   {/* easy */
    if (this.ind>=0)
     return cmant; // non-negative integer
    rec=new Array(cmant.length+1);
    rec[0]='-';
    //--java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,1,cmant.length);
    this.arraycopy(cmant,0,rec,1,cmant.length);
    return rec;
   }

  /* Need a '.' and/or some zeros */
  needsign=((this.ind==this.isneg)?1:0); // space for sign?  0 or 1

  /* MAG is the position of the point in the mantissa (index of the
     character it follows) */
  mag=this.exp+cmant.length;

  if (mag<1)
   {/* 0.00xxxx form */
    len=(needsign+2)-this.exp; // needsign+2+(-mag)+cmant.length
    rec=new Array(len);
    if (needsign!=0)
     rec[0]='-';
    rec[needsign]='0';
    rec[needsign+1]='.';
    {var $20=-mag;i=needsign+2;i:for(;$20>0;$20--,i++){ // maybe none
     rec[i]='0';
     }
    }/*i*/
    //--java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,(needsign+2)-mag,cmant.length);
    this.arraycopy(cmant,0,rec,(needsign+2)-mag,cmant.length);
    return rec;
   }

  if (mag>cmant.length)
   {/* xxxx0000 form */
    len=needsign+mag;
    rec=new Array(len);
    if (needsign!=0)
     rec[0]='-';
    //--java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,needsign,cmant.length);
    this.arraycopy(cmant,0,rec,needsign,cmant.length);
    {var $21=mag-cmant.length;i=needsign+cmant.length;i:for(;$21>0;$21--,i++){ // never 0
     rec[i]='0';
     }
    }/*i*/
    return rec;
   }

  /* decimal point is in the middle of the mantissa */
  len=(needsign+1)+cmant.length;
  rec=new Array(len);
  if (needsign!=0)
   rec[0]='-';
  //--java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,needsign,mag);
  this.arraycopy(cmant,0,rec,needsign,mag);
  rec[needsign+mag]='.';
  //--java.lang.System.arraycopy((java.lang.Object)cmant,mag,(java.lang.Object)rec,(needsign+mag)+1,cmant.length-mag);
  this.arraycopy(cmant,mag,rec,(needsign+mag)+1,cmant.length-mag);
  return rec;
  }
Translates a <code>long</code> to a <code>BigDecimal</code> with a
given scale.
That is, returns a plain <code>BigDecimal</code> whose unscaled
value is equal to the given <code>long</code>, adjusted by the
second parameter, <code>scale</code>.
<p>
The result is given by:
<p><code>
(new BigDecimal(lint)).divide(TEN.pow(new BigDecimal(scale)))
</code>
<p>
A <code>NumberFormatException</code> is thrown if <code>scale</code>
is negative.

@param  lint  The <code>long</code> to be translated.
@param  scale The <code>int</code> scale to be applied.
@return       The <code>BigDecimal</code> equal in value to
              <code>lint</code>.
@throws NumberFormatException if the scale is negative.
@stable ICU 2.0