double fract = current - Math.rint(current);
double fract = Math.abs(current - Math.rint(current));
  public String toString() {    // Determine the width required for the maximum element,    // and check for fractional display requirement.    double maxval = 0;    boolean fractional = false;    for (int i = 0; i < getRowDimension(); i++) {      for (int j = 0; j < getColumnDimension(); j++) {        double current = get(i, j);        if (current < 0)          current *= -10;        if (current > maxval)          maxval = current;        double fract = current - Math.rint(current);        if (!fractional            && ((Math.log(fract) / Math.log(10)) >= -2)) {          fractional = true;        }      }    }    int width = (int)(Math.log(maxval) / Math.log(10)         + (fractional ? 4 : 1));    StringBuffer text = new StringBuffer();       for (int i = 0; i < getRowDimension(); i++) {      for (int j = 0; j < getColumnDimension(); j++)        text.append(" ").append(Utils.doubleToString(get(i, j),              width, (fractional ? 2 : 0)));      text.append("\n");    }    return text.toString();  } 