protected int align(int e){
  int lostdigit=0;
  boolean inexact=false;
  int diff=exp - e;
  int adiff=diff;
  if (adiff < 0) {
    adiff=-adiff;
  }
  if (diff == 0) {
    return 0;
  }
  if (adiff > (mant.length + 1)) {
    Arrays.fill(mant,0);
    exp=e;
    field.setIEEEFlagsBits(DfpField.FLAG_INEXACT);
    dotrap(DfpField.FLAG_INEXACT,ALIGN_TRAP,this,this);
    return 0;
  }
  for (int i=0; i < adiff; i++) {
    if (diff < 0) {
      if (lostdigit != 0) {
        inexact=true;
      }
      lostdigit=mant[0];
      shiftRight();
    }
 else {
      shiftLeft();
    }
  }
  if (inexact) {
    field.setIEEEFlagsBits(DfpField.FLAG_INEXACT);
    dotrap(DfpField.FLAG_INEXACT,ALIGN_TRAP,this,this);
  }
  return lostdigit;
}

protected int align ( int e ) { int lostdigit = 0 ; boolean inexact = false ; int diff = exp - e ; int adiff = diff ; if ( adiff < 0 ) { adiff = - adiff ; } if ( diff == 0 ) { return 0 ; } if ( adiff > ( mant . length + 1 ) ) { Arrays . fill ( mant , 0 ) ; exp = e ; field . setIEEEFlagsBits ( DfpField . FLAG_INEXACT ) ; dotrap ( DfpField . FLAG_INEXACT , ALIGN_TRAP , this , this ) ; return 0 ; } for ( int i = 0 ; i < adiff ; i ++ ) { if ( diff < 0 ) { if ( lostdigit != 0 ) { inexact = true ; } lostdigit = mant [ 0 ] ; shiftRight ( ) ; } else { shiftLeft ( ) ; } } if ( inexact ) { field . setIEEEFlagsBits ( DfpField . FLAG_INEXACT ) ; dotrap ( DfpField . FLAG_INEXACT , ALIGN_TRAP , this , this ) ; } return lostdigit ; }
make our exp equal to the supplied one , this may cause rounding . also causes de - normalized numbers . these numbers are generally dangerous because most routines assume normalized numbers . align doesn ' t round , so it will return the last digit destroyed by shifting right .
