function BigDecimal() {
  //-- members
  this.ind = 0;
  this.form = MathContext.prototype.PLAIN;
  this.mant = null;
  this.exp = 0;

  //-- overloaded ctor
  if (BigDecimal.arguments.length == 0)
   return;
  var inchars;
  var offset;
  var length;
  if (BigDecimal.arguments.length == 1)
   {
    inchars = BigDecimal.arguments[0];
    offset = 0;
    length = inchars.length;
   }
  else
   {
    inchars = BigDecimal.arguments[0];
    offset = BigDecimal.arguments[1];
    length = BigDecimal.arguments[2];
   }
  if (typeof inchars == "string")
   {
    inchars = inchars.split("");
   }

  //--boolean exotic;
  var exotic;
  //--boolean hadexp;
  var hadexp;
  //--int d;
  var d;
  //--int dotoff;
  var dotoff;
  //--int last;
  var last;
  //--int i=0;
  var i=0;
  //--char si=0;
  var si=0;
  //--boolean eneg=false;
  var eneg=false;
  //--int k=0;
  var k=0;
  //--int elen=0;
  var elen=0;
  //--int j=0;
  var j=0;
  //--char sj=0;
  var sj=0;
  //--int dvalue=0;
  var dvalue=0;
  //--int mag=0;
  var mag=0;
  // This is the primary constructor; all incoming strings end up
  // here; it uses explicit (inline) parsing for speed and to avoid
  // generating intermediate (temporary) objects of any kind.
  // 1998.06.25: exponent form built only if E/e in string
  // 1998.06.25: trailing zeros not removed for zero
  // 1999.03.06: no embedded blanks; allow offset and length
  if (length<=0)
   this.bad("BigDecimal(): ", inchars); // bad conversion (empty string)
  // [bad offset will raise array bounds exception]

  /* Handle and step past sign */
  this.ind=this.ispos; // assume positive
  if (inchars[0]==('-'))
   {
    length--;
    if (length==0)
     this.bad("BigDecimal(): ", inchars); // nothing after sign
    this.ind=this.isneg;
    offset++;
   }
  else
   if (inchars[0]==('+'))
    {
     length--;
     if (length==0)
      this.bad("BigDecimal(): ", inchars); // nothing after sign
     offset++;
    }

  /* We're at the start of the number */
  exotic=false; // have extra digits
  hadexp=false; // had explicit exponent
  d=0; // count of digits found
  dotoff=-1; // offset where dot was found
  last=-1; // last character of mantissa
  {var $1=length;i=offset;i:for(;$1>0;$1--,i++){
   si=inchars[i];
   if (si>='0')  // test for Arabic digit
    if (si<='9')
     {
      last=i;
      d++; // still in mantissa
      continue i;
     }
   if (si=='.')
    { // record and ignore
     if (dotoff>=0)
      this.bad("BigDecimal(): ", inchars); // two dots
     dotoff=i-offset; // offset into mantissa
     continue i;
    }
   if (si!='e')
    if (si!='E')
     { // expect an extra digit
      if (si<'0' || si>'9')
       this.bad("BigDecimal(): ", inchars); // not a number
      // defer the base 10 check until later to avoid extra method call
      exotic=true; // will need conversion later
      last=i;
      d++; // still in mantissa
      continue i;
     }
   /* Found 'e' or 'E' -- now process explicit exponent */
   // 1998.07.11: sign no longer required
   if ((i-offset)>(length-2))
    this.bad("BigDecimal(): ", inchars); // no room for even one digit
   eneg=false;
   if ((inchars[i+1])==('-'))
    {
     eneg=true;
     k=i+2;
    }
   else
    if ((inchars[i+1])==('+'))
     k=i+2;
    else
     k=i+1;
   // k is offset of first expected digit
   elen=length-((k-offset)); // possible number of digits
   if ((elen==0)||(elen>9))
    this.bad("BigDecimal(): ", inchars); // 0 or more than 9 digits
   {var $2=elen;j=k;j:for(;$2>0;$2--,j++){
    sj=inchars[j];
    if (sj<'0')
     this.bad("BigDecimal(): ", inchars); // always bad
    if (sj>'9')
     { // maybe an exotic digit
      /*if (si<'0' || si>'9')
       this.bad(inchars); // not a number
      dvalue=java.lang.Character.digit(sj,10); // check base
      if (dvalue<0)
       bad(inchars); // not base 10*/
      this.bad("BigDecimal(): ", inchars);
     }
    else
     dvalue=sj-'0';
    this.exp=(this.exp*10)+dvalue;
    }
   }/*j*/
   if (eneg)
    this.exp=-this.exp; // was negative
   hadexp=true; // remember we had one
   break i; // we are done
   }
  }/*i*/

  /* Here when all inspected */
  if (d==0)
   this.bad("BigDecimal(): ", inchars); // no mantissa digits
  if (dotoff>=0)
   this.exp=(this.exp+dotoff)-d; // adjust exponent if had dot

  /* strip leading zeros/dot (leave final if all 0's) */
  {var $3=last-1;i=offset;i:for(;i<=$3;i++){
   si=inchars[i];
   if (si=='0')
    {
     offset++;
     dotoff--;
     d--;
    }
   else
    if (si=='.')
     {
      offset++; // step past dot
      dotoff--;
     }
    else
     if (si<='9')
      break i;/* non-0 */
     else
      {/* exotic */
       //if ((java.lang.Character.digit(si,10))!=0)
        break i; // non-0 or bad
       // is 0 .. strip like '0'
       //offset++;
       //dotoff--;
       //d--;
      }
   }
  }/*i*/

  /* Create the mantissa array */
  this.mant=new Array(d); // we know the length
  j=offset; // input offset
  if (exotic)
   {exotica:do{ // slow: check for exotica
    {var $4=d;i=0;i:for(;$4>0;$4--,i++){
     if (i==dotoff)
      j++; // at dot
     sj=inchars[j];
     if (sj<='9')
      this.mant[i]=sj-'0';/* easy */
     else
      {
       //dvalue=java.lang.Character.digit(sj,10);
       //if (dvalue<0)
        this.bad("BigDecimal(): ", inchars); // not a number after all
       //mant[i]=(byte)dvalue;
      }
     j++;
     }
    }/*i*/
   }while(false);}/*exotica*/
  else
   {simple:do{
    {var $5=d;i=0;i:for(;$5>0;$5--,i++){
     if (i==dotoff)
      j++;
     this.mant[i]=inchars[j]-'0';
     j++;
     }
    }/*i*/
   }while(false);}/*simple*/

  /* Looks good.  Set the sign indicator and form, as needed. */
  // Trailing zeros are preserved
  // The rule here for form is:
  //   If no E-notation, then request plain notation
  //   Otherwise act as though add(0,DEFAULT) and request scientific notation
  // [form is already PLAIN]
  if (this.mant[0]==0)
   {
    this.ind=this.iszero; // force to show zero
    // negative exponent is significant (e.g., -3 for 0.000) if plain
    if (this.exp>0)
     this.exp=0; // positive exponent can be ignored
    if (hadexp)
     { // zero becomes single digit from add
      this.mant=this.ZERO.mant;
      this.exp=0;
     }
   }
  else
   { // non-zero
    // [ind was set earlier]
    // now determine form
    if (hadexp)
     {
      this.form=MathContext.prototype.SCIENTIFIC;
      // 1999.06.29 check for overflow
      mag=(this.exp+this.mant.length)-1; // true exponent in scientific notation
      if ((mag<this.MinExp)||(mag>this.MaxExp))
       this.bad("BigDecimal(): ", inchars);
     }
   }
  // say 'BD(c[]): mant[0] mantlen exp ind form:' mant[0] mant.length exp ind form
  return;
  }
Constructs a <code>BigDecimal</code> object from an array of characters.
<p>
Constructs a <code>BigDecimal</code> as though a
<code>String</code> had been constructed from the character array
(or a subarray of that array) and the
{@link #BigDecimal(java.lang.String)} constructor had then been
used. The first parameter must not be <code>null</code>, and the
subarray must be wholly contained within it.
<p>
Using this constructor is faster than using the
<code>BigDecimal(String)</code> constructor if the string is
already available within a character array.

@param inchars The <code>char[]</code> array containing the number
               to be converted.
@param offset  The <code>int</code> offset into the array of the
               start of the number to be converted.
@param length  The <code>int</code> length of the number.
@throws NumberFormatException if the parameter is not a valid
               number for any reason.
@stable ICU 2.0