protected Dfp(final DfpField field,long x){
  mant=new int[field.getRadixDigits()];
  nans=FINITE;
  this.field=field;
  boolean isLongMin=false;
  if (x == Long.MIN_VALUE) {
    isLongMin=true;
    ++x;
  }
  if (x < 0) {
    sign=-1;
    x=-x;
  }
 else {
    sign=1;
  }
  exp=0;
  while (x != 0) {
    System.arraycopy(mant,mant.length - exp,mant,mant.length - 1 - exp,exp);
    mant[mant.length - 1]=(int)(x % RADIX);
    x/=RADIX;
    exp++;
  }
  if (isLongMin) {
    for (int i=0; i < mant.length - 1; i++) {
      if (mant[i] != 0) {
        mant[i]++;
        break;
      }
    }
  }
}

protected Dfp ( final DfpField field , long x ) { mant = new int [ field . getRadixDigits ( ) ] ; nans = FINITE ; this . field = field ; boolean isLongMin = false ; if ( x == Long . MIN_VALUE ) { isLongMin = true ; ++ x ; } if ( x < 0 ) { sign = - 1 ; x = - x ; } else { sign = 1 ; } exp = 0 ; while ( x != 0 ) { System . arraycopy ( mant , mant . length - exp , mant , mant . length - 1 - exp , exp ) ; mant [ mant . length - 1 ] = ( int ) ( x % RADIX ) ; x /= RADIX ; exp ++ ; } if ( isLongMin ) { for ( int i = 0 ; i < mant . length - 1 ; i ++ ) { if ( mant [ i ] != 0 ) { mant [ i ] ++ ; break ; } } } }
create an instance from a long value .
