protected static Dfp[] split(final DfpField field,final String a){
  Dfp result[]=new Dfp[2];
  char[] buf;
  boolean leading=true;
  int sp=0;
  int sig=0;
  buf=new char[a.length()];
  for (int i=0; i < buf.length; i++) {
    buf[i]=a.charAt(i);
    if (buf[i] >= '1' && buf[i] <= '9') {
      leading=false;
    }
    if (buf[i] == '.') {
      sig+=(400 - sig) % 4;
      leading=false;
    }
    if (sig == (field.getRadixDigits() / 2) * 4) {
      sp=i;
      break;
    }
    if (buf[i] >= '0' && buf[i] <= '9' && !leading) {
      sig++;
    }
  }
  result[0]=field.newDfp(new String(buf,0,sp));
  for (int i=0; i < buf.length; i++) {
    buf[i]=a.charAt(i);
    if (buf[i] >= '0' && buf[i] <= '9' && i < sp) {
      buf[i]='0';
    }
  }
  result[1]=field.newDfp(new String(buf));
  return result;
}

protected static Dfp [ ] split ( final DfpField field , final String a ) { Dfp result [ ] = new Dfp [ 2 ] ; char [ ] buf ; boolean leading = true ; int sp = 0 ; int sig = 0 ; buf = new char [ a . length ( ) ] ; for ( int i = 0 ; i < buf . length ; i ++ ) { buf [ i ] = a . charAt ( i ) ; if ( buf [ i ] >= '1' && buf [ i ] <= '9' ) { leading = false ; } if ( buf [ i ] == '.' ) { sig += ( 400 - sig ) % 4 ; leading = false ; } if ( sig == ( field . getRadixDigits ( ) / 2 ) * 4 ) { sp = i ; break ; } if ( buf [ i ] >= '0' && buf [ i ] <= '9' && ! leading ) { sig ++ ; } } result [ 0 ] = field . newDfp ( new String ( buf , 0 , sp ) ) ; for ( int i = 0 ; i < buf . length ; i ++ ) { buf [ i ] = a . charAt ( i ) ; if ( buf [ i ] >= '0' && buf [ i ] <= '9' && i < sp ) { buf [ i ] = '0' ; } } result [ 1 ] = field . newDfp ( new String ( buf ) ) ; return result ; }
breaks a string representation up into two dfp ' s . < p > the two dfp are such that the sum of them is equivalent to the input string , but has higher precision than using a single dfp . this is useful for improving accuracy of exponentiation and critical multiplies .
